Compare commits

...
Author SHA1 Message Date
ouyangxq c76b9888f5 Read frozen dispatch driver license through its exact driver owner 2026-10-20 10:38:20 +08:00
ouyangxq 135ffa662d Fix dispatch physical warehouse binding and empty cancellation 2026-10-20 09:32:13 +08:00
ouyangxq a8037fd97d Fix native dispatch warehouse text projection and TEST receipt setup 2026-10-20 09:16:16 +08:00
ouyangxq d7616899d8 Unify dispatch operations with matched published transfer fixture 2026-10-20 00:29:25 +08:00
ouyangxq a563f63857 feat(appointments): expose destination warehouse options 2026-10-19 17:02:25 +08:00
ouyangxq eb167347f6 test(transfer): prepare source snapshot before foreign relabel ownership check 2026-10-19 15:19:09 +08:00
ouyangxq c8608d50ba merge: retain current overseas inventory fixes with looseboard demand 2026-10-19 15:11:45 +08:00
ouyangxq dff040b509 feat(looseboard): require route contacts and pickup delivery times 2026-10-19 15:11:15 +08:00
liuyihe 26a203b4eb 提交 2026-10-19 15:00:25 +08:00
ouyangxq 21128b895f feat(trucking): refine truck demand contacts vehicle and service times 2026-10-19 14:34:33 +08:00
ouyangxq fafcf75014 fix(appointments): exclude pickup trips from delivery calendar 2026-10-19 12:21:57 +08:00
ouyangxq aa195cef66 feat(appointments): add four-type calendar sources and align release contracts 2026-10-19 12:15:43 +08:00
liuyihe fe1b2a6a46 提交 2026-10-19 11:54:29 +08:00
liuyihe e8f6bb32dc 提交 2026-10-19 10:23:09 +08:00
ouyangxq 45fbd6eff8 fix(lastleg): reconfirm received bookings after releasing all own cargo 2026-10-18 19:53:35 +08:00
ouyangxq 2c330bf9df test(lastleg): derive merchant relabel scope from profile receipt 2026-10-18 19:29:35 +08:00
ouyangxq 4bef8577fa test(lastleg): verify dispatch repair with current-run HTTP evidence 2026-10-18 19:21:12 +08:00
ouyangxq db4354bda8 fix(lastleg): align return receipt fixtures and schema totals 2026-10-18 18:45:47 +08:00
ouyangxq aa33514ec6 fix(lastleg): repair dispatch cancellation and return execution contracts 2026-10-18 16:34:14 +08:00
ouyangxq 66a0beb653 test(lastleg): mark diagnostic fixture mapper for registration contract 2026-10-18 11:49:47 +08:00
ouyangxq 5cd108b39a chore(lastleg): instrument appointment latency from restored 662dead baseline 2026-10-18 11:43:10 +08:00
ouyangxq b0acbfbb34 perf(lastleg): batch appointment requirement generation reads 2026-10-17 12:54:39 +08:00
ouyangxq 662dead053 chore(lastleg): diagnose work fact synchronization phases 2026-10-17 11:37:57 +08:00
ouyangxq 2971d6f7f0 perf(lastleg): reuse warehouse directory within sync generation 2026-10-17 09:57:54 +08:00
ouyangxq 81e4123b10 perf(lastleg): limit transport reconciliation facts and trace sync phases 2026-10-17 09:11:00 +08:00
ouyangxq 732cf99007 perf(lastleg): reuse work items within synchronization batch 2026-10-17 08:30:11 +08:00
ouyangxq 5fd74e9c8c perf(lastleg): batch receiving candidates and trace slow work invalidation 2026-10-17 07:49:56 +08:00
ouyangxq af97cd17d0 Merge production prebuild test fixes into frozen release 2026-10-16 18:44:42 +08:00
ouyangxq 5f5133bd68 test(lastleg): separate stable carton marks from return numbers 2026-10-16 18:44:32 +08:00
ouyangxq 339c70bb56 test(lastleg): isolate SQL semantic tests in bounded CI 2026-10-16 18:41:25 +08:00
ouyangxq e4bf573146 test: integrate production preflight contract correction 2026-10-16 18:14:49 +08:00
ouyangxq 4348296daf test(lastleg): validate shared appointment contract references 2026-10-16 18:14:37 +08:00
liuyihe 9ea03eb540 提交 2026-10-16 17:43:07 +08:00
liuyihe c9186c37a5 提交 2026-10-16 16:56:33 +08:00
liuyihe 6211d4ae37 提交 2026-10-16 16:53:32 +08:00
ouyangxq fee0268391 fix(appointment): link customer work to original batch requirement 2026-10-16 16:38:33 +08:00
ouyangxq 38a1f1079a Merge remote-tracking branch 'origin/test' into test 2026-10-16 16:21:51 +08:00
ouyangxq 58685945b1 fix(appointment): exclude cancelled batches without active allocations 2026-10-16 16:21:51 +08:00
liuyihe ecded9e58b 提交 2026-10-16 16:18:39 +08:00
liuyihe 488c0318ff 提交 2026-10-16 16:18:28 +08:00
ouyangxq 000125c3ec chore(sql): normalize merged initialization ending 2026-10-16 15:45:18 +08:00
ouyangxq 0708bbad2e Merge remote-tracking branch 'origin/test' into test
# Conflicts:
#	deploy/sql/README.md
#	deploy/sql/海外区域统一增量-MySQL8.sql
2026-10-16 15:44:59 +08:00
ouyangxq 30f48bd926 feat(appointments): support scoped receiving and stable trip continuation 2026-10-16 15:43:04 +08:00
liuyihe 358feb5567 提交 2026-10-16 13:57:39 +08:00
liuyihe 5855529e97 提交 2026-10-16 11:41:24 +08:00
ouyangxq 4e2ea89403 fix(selfop): retry continuous outbound failures with bounded diagnostics 2026-10-16 11:05:37 +08:00
ouyangxq a3a5862f89 fix(delivery): use frozen relabel destination in SKU details 2026-10-15 21:48:18 +08:00
ouyangxq b8739eebf0 fix(lastleg): preserve return relabel delivery metadata and measurements 2026-10-15 21:40:37 +08:00
ouyangxq 607aaf74dc fix(lastleg): route all relabel pickups directly to outbound and verify final schemas 2026-10-15 21:05:34 +08:00
ouyangxq 4277601999 perf(firstleg): scope appointment fact source aggregation by container 2026-10-15 20:03:41 +08:00
ouyangxq ae33780dae fix(order): project exact customer fulfillment progress in detail 2026-10-15 19:46:34 +08:00
ouyangxq 097bec33b1 perf(lastleg): batch live appointment work facts and filter candidates 2026-10-15 19:10:57 +08:00
ouyangxq abf4e45e39 perf(firstleg): batch appointment source and execution facts 2026-10-15 19:08:18 +08:00
ouyangxq 2631bd3af4 fix(dispatch): use supported capacity for default draft groups 2026-10-15 18:45:05 +08:00
liuyihe cda5f3dc32 提交 2026-10-15 18:25:53 +08:00
ouyangxq caff693ad8 test(appointments): verify stable batches and current HTTP contracts 2026-10-15 18:13:52 +08:00
ouyangxq 204ae10737 fix(dispatch): persist and reuse the resolved draft group 2026-10-15 18:12:55 +08:00
ouyangxq 23ce486539 fix(firstleg): reuse source manifest within work fact batches 2026-10-15 17:52:56 +08:00
ouyangxq 994215d981 fix(appointment): keep source inspection in work transaction 2026-10-15 17:34:45 +08:00
ouyangxq 42679d4d54 fix(appointment): retain unbookable cargo as blocked work 2026-10-15 17:28:22 +08:00
ouyangxq 14b8cc625b fix(appointment): retain safe synchronization failure diagnostics 2026-10-15 17:18:09 +08:00
ouyangxq 4f9a63fb01 merge: integrate TEST updates and verify appointment release 2026-10-15 17:08:30 +08:00
ouyangxq a1d5ebdab2 feat(appointment): integrate work calendar and stable cargo batches 2026-10-15 16:55:57 +08:00
liuyihe 628b1a5732 提交 2026-10-15 16:30:37 +08:00
liuyihe c6bd6af5ce 提交 2026-10-15 15:42:10 +08:00
liuyihe 095a95e64a Merge remote-tracking branch 'origin/test' into test
# Conflicts:
#	deploy/sql/README.md
2026-10-15 15:02:34 +08:00
ouyangxq dbb93a06c2 feat(selfop): provide frozen turnover batches for backend Excel exports 2026-10-15 15:00:03 +08:00
ouyangxq 22d79e08f9 fix(selfop): restore unique same-second inventory chains 2026-10-15 14:13:41 +08:00
ouyangxq 235b9469d9 fix(selfop): remove obsolete execution binding on config refresh 2026-10-15 13:48:49 +08:00
ouyangxq 99215bbb79 feat(selfop): reconstruct historical inventory and publish qualified turnover 2026-10-15 13:30:37 +08:00
ouyangxq d81d9cbda4 feat(selfop): add bounded inventory flow diagnostic through account egress 2026-10-15 11:37:49 +08:00
ouyangxq e19d303a76 feat(selfop): filter turnover by multiple owners across all aggregates 2026-10-15 11:12:44 +08:00
ouyangxq 72d7ed6962 feat(selfop): hide known zero inventory before turnover pagination 2026-10-15 10:29:42 +08:00
liuyihe d663d53747 Merge remote-tracking branch 'origin/test' into test 2026-10-14 20:27:06 +08:00
ouyangxq b7fb3a5054 feat(selfop): add owner inventory volume top ten chart 2026-10-14 18:17:09 +08:00
ouyangxq 7079455eb0 fix(selfop): support inventory and outbound volume sorting 2026-10-14 18:11:02 +08:00
liuyihe 471e50ffe1 提交 2026-10-14 18:01:25 +08:00
ouyangxq 8bc8518496 feat(selfop): calculate inventory and outbound volume by owner and SKU 2026-10-14 17:48:52 +08:00
ouyangxq 814eb11d2f fix(selfop): avoid loading routing manifests during idle planning 2026-10-14 17:26:41 +08:00
ouyangxq 1112d11c80 fix(lastleg): pace master data pages without holding collection leases 2026-10-14 16:56:40 +08:00
ouyangxq 63883f4ffd fix(integration): read master data source pagination fields 2026-10-14 16:43:11 +08:00
ouyangxq d311d9dc8d feat(selfop): sync versioned owner and product directories 2026-10-14 16:15:39 +08:00
ouyangxq 2b3b13913b feat(self-operated): expose and sort transit stock in turnover views 2026-10-14 14:08:52 +08:00
ouyangxq 5ace2fb584 Merge remote-tracking branch 'origin/test' into test 2026-10-14 14:01:40 +08:00
ouyangxq 6e7d922853 fix(self-operated): align turnover sales eligibility and known zero stock 2026-10-14 14:01:39 +08:00
liuyihe 1425b284dd 提交 2026-10-14 13:57:04 +08:00
liuyihe d017f5d881 提交 2026-10-14 13:42:58 +08:00
ouyangxq bc9c78122b feat(self-operated): support selected-day analytics and global quantity sorting 2026-10-14 12:44:15 +08:00
liuyihe 287edcf32b 提交 2026-10-14 12:13:26 +08:00
liuyihe 166280da5a 贴标申请,仓储转运 2026-10-14 11:37:38 +08:00
liuyihe e14bdb4f49 贴标申请,仓储转运 2026-10-14 11:36:35 +08:00
ouyangxq 83dc6dea3f 优化 2026-10-14 11:03:02 +08:00
ouyangxq 6193043880 perf(selfop): batch list checkpoints and publish each completed day 2026-10-14 10:09:16 +08:00
ouyangxq 674914c651 fix(selfop): allow explicit retry of failed continuous inventory roots 2026-10-14 09:46:49 +08:00
ouyangxq 2e2a354ba6 fix(selfop): retain turnover precision and scope reused publication runs 2026-10-14 09:37:00 +08:00
ouyangxq 6024faa9aa fix(selfop): isolate inventory paging and bound unstable scan retries 2026-10-14 09:36:52 +08:00
ouyangxq 0aa188445b fix(selfop): allow controlled continuous inventory retry in test 2026-10-14 09:29:08 +08:00
ouyangxq c0e1d42b62 perf(selfop): route collected orders once after resolution 2026-10-14 08:55:58 +08:00
ouyangxq c640fa2d0d feat(selfop): prefer list SKU quantities with targeted detail fallback 2026-10-14 08:15:16 +08:00
ouyangxq 4ae158c93e fix(selfop): preserve exact diagnostic decimals in JSON evidence 2026-10-14 05:05:23 +08:00
ouyangxq 913b9e9262 fix(selfop): persist bounded next-root quantity diagnostics 2026-10-14 04:59:05 +08:00
ouyangxq 765b6e6208 perf(lastleg): reduce inventory turnover query aggregation work 2026-10-14 03:36:54 +08:00
ouyangxq 16d0b9c80f fix: finalize inventory turnover queries and reuse snapshot aggregation 2026-10-14 01:51:51 +08:00
ouyangxq d029f9a19e 优化 2026-10-14 00:07:12 +08:00
ouyangxq 3d3507a770 feat(selfop): add bounded independent quantity diagnostic capture 2026-10-13 23:40:44 +08:00
ouyangxq 54f79b3902 feat(self-operated): expose private runtime configuration snapshots 2026-10-13 22:23:48 +08:00
ouyangxq 1d0b0918ba Merge commit 'b033a89aaf0af286cdf60cb2cdc2d51fd02deab1' into test 2026-10-13 21:51:00 +08:00
ouyangxq f1fb5662ca fix(self-operated): remove business collection deadline limits 2026-10-13 21:39:51 +08:00
ouyangxq 242a76221e feat(self-operated): persist continuous collection and frozen coverage 2026-10-13 21:13:31 +08:00
liuyihe b033a89aaf 贴标申请,仓储转运 2026-10-13 20:51:44 +08:00
ouyangxq c2bb769676 fix(selfop): remove business request count quotas 2026-10-13 20:02:07 +08:00
ouyangxq f151e74f5c fix(self-operated): rank hot SKUs for selected dates 2026-10-13 18:44:49 +08:00
liuyihe 38958c891a 贴标申请,仓储转运 2026-10-13 18:05:30 +08:00
liuyihe c07131b26f 贴标申请,仓储转运 2026-10-13 17:42:54 +08:00
ouyangxq ec7e9b36ec Merge remote-tracking branch 'origin/test' into test 2026-10-13 16:53:38 +08:00
ouyangxq 146d468ff4 feat: expose reliable collection activity and stage estimates 2026-10-13 16:50:53 +08:00
liuyihe 55764497c8 贴标申请,仓储转运 2026-10-13 16:48:54 +08:00
liuyihe 03601ab0aa 贴标申请,仓储转运 2026-10-13 15:55:31 +08:00
liuyihe c84b5f460a 贴标申请,仓储转运 2026-10-13 14:46:22 +08:00
liuyihe 89a05a2348 贴标申请,仓储转运 2026-10-13 13:46:16 +08:00
ouyangxq cebcdfb66e fix: preserve complete historical dashboard days 2026-10-13 13:43:13 +08:00
ouyangxq 496fc11b0a feat(selfop): support complete inventory sales windows 2026-10-13 12:35:39 +08:00
ouyangxq 39f914b3b5 fix(lingxing): allow bounded configurable business request pacing 2026-10-13 11:46:57 +08:00
ouyangxq 6e9466d0b4 Merge remote-tracking branch 'origin/test' into test 2026-10-13 11:19:19 +08:00
ouyangxq ed8c9b1543 test(selfop): verify every coverage bucket identity and pagination 2026-10-13 11:18:40 +08:00
liuyihe ce4eb4e8a2 Merge remote-tracking branch 'origin/test' into test 2026-10-13 11:00:37 +08:00
liuyihe 3b86a6d779 贴标申请,仓储转运 2026-10-13 11:00:31 +08:00
liuyihe c920d954ef 贴标申请,仓储转运 2026-10-13 10:47:58 +08:00
liuyihe f7a871e3e4 贴标申请,仓储转运 2026-10-13 10:47:52 +08:00
ouyangxq c13bf96cb9 feat(selfop): expose opt-in test query timing headers 2026-10-13 10:42:19 +08:00
ouyangxq 4c9878c338 feat(selfop): add opt-in test query timing diagnostics 2026-10-13 10:31:46 +08:00
ouyangxq d08ed2f2ca perf(selfop): seek latest outbound date for inventory page 2026-10-13 10:11:06 +08:00
ouyangxq 2d7b6e4381 test(selfop): verify warehouse summary build transactions 2026-10-13 10:04:06 +08:00
ouyangxq 25db631ff7 perf(selfop): build versioned warehouse daily sales summaries 2026-10-13 09:40:55 +08:00
ouyangxq ca4e7086e9 perf(selfop): skip unavailable dashboard aggregates 2026-10-13 03:45:01 +08:00
ouyangxq 7ae91eb276 fix(lastleg): persist bounded test collection session budgets 2026-10-13 03:08:36 +08:00
ouyangxq 1fdd978084 perf(selfop): paginate sales summary before day coverage enrichment 2026-10-13 02:46:20 +08:00
ouyangxq 341b7635c7 perf(selfop): materialize sales bounds without redundant deduplication 2026-10-13 02:31:46 +08:00
ouyangxq afd3bbaa3d perf(selfop): page stock keys before sales enrichment 2026-10-13 02:13:56 +08:00
ouyangxq 2c8c26490a perf(selfop): stabilize profile candidate join order 2026-10-13 02:00:14 +08:00
ouyangxq bf693fab6b perf(selfop): index staged observation joins and verify candidate builds 2026-10-13 01:47:17 +08:00
ouyangxq d689112656 perf(selfop): share dashboard aggregates and cover daily trend reads 2026-10-13 01:29:14 +08:00
ouyangxq 99d206eb00 perf(selfop): cover range reads and stream yearly SKU aggregation 2026-10-13 01:05:52 +08:00
ouyangxq a41c271a67 feat(selfop): add warehouse dashboard and exact inventory drilldowns 2026-10-13 00:45:39 +08:00
ouyangxq a84a9b730e fix(selfop): publish proven manual sales windows for configured warehouses 2026-10-13 00:30:48 +08:00
ouyangxq ae1a809357 fix(selfop): publish complete single-pass inventory observations 2026-10-13 00:10:12 +08:00
ouyangxq 51c0d77fd4 fix(selfop): stabilize inventory and order quantity fingerprints 2026-10-12 23:50:39 +08:00
ouyangxq 86e05a77e6 fix(selfop): allow controlled manual collection in test 2026-10-12 23:21:57 +08:00
ouyangxq 6e9f4b7932 perf(selfop): aggregate daily facts before SKU coverage calculations 2026-10-12 23:06:45 +08:00
ouyangxq cbc316b34d fix(selfop): expose scoped validation tasks without published scopes 2026-10-12 22:57:18 +08:00
ouyangxq b71380de31 fix(selfop): discover warehouses with bounded validation and optimize queries 2026-10-12 22:22:08 +08:00
ouyangxq e42d358e71 Merge remote-tracking branch 'origin/test' into test 2026-10-12 21:25:28 +08:00
ouyangxq 06de9b1c93 test(selfop): verify publication transactions against opt-in TEST MySQL 2026-10-12 21:24:56 +08:00
liuyihe fb98b1a8ee 贴标申请,仓储转运 2026-10-12 21:18:29 +08:00
ouyangxq 8526697b08 fix: quote inline descriptions in Lingxing OpenAPI contract 2026-10-12 21:10:18 +08:00
ouyangxq b702ed9f45 test: verify self-operated analytics through TEST Gateway and synthetic query fixtures 2026-10-12 20:59:54 +08:00
ouyangxq d4dc4f875a fix: register current synchronous service dependencies and guard callback boundaries 2026-10-12 20:58:16 +08:00
ouyangxq d782b2cd24 fix: reject unavailable self-operated collection commands before initialization 2026-10-12 20:45:31 +08:00
ouyangxq 3b137f8946 Merge remote-tracking branch 'origin/test' into test 2026-10-12 20:27:50 +08:00
ouyangxq a1f1d93902 feat: add self-operated analytics and enforce Lastleg module boundaries 2026-10-12 20:27:35 +08:00
liuyihe 0eb58f9dd1 贴标申请,仓储转运 2026-10-12 18:19:08 +08:00
liuyihe 9b333df720 贴标申请,仓储转运 2026-10-12 18:11:23 +08:00
liuyihe 46507e41c6 贴标申请,仓储转运 2026-10-12 18:01:16 +08:00
ouyangxq c06e788b0f fix: complete single-order acceptance and add Lingxing WMS integration 2026-10-12 16:09:21 +08:00
liuyihe 6c4ee2bfde 贴标申请,仓储转运 2026-10-12 15:57:47 +08:00
liuyihe a1cd47dabd 贴标申请,仓储转运 2026-10-12 13:42:23 +08:00
liuyihe ea3aae6093 Merge remote-tracking branch 'origin/test' into test 2026-10-12 13:42:13 +08:00
ouyangxq c545a77190 test(firstleg): keep sailing copy dates in the future 2026-10-12 11:48:49 +08:00
ouyangxq 3cb4a5676a fix(firstleg): use a single cabinet business number 2026-10-12 11:44:58 +08:00
liuyihe b4b00ae3dd 贴标申请,仓储转运 2026-10-12 11:18:58 +08:00
ouyangxq 29b562ebf5 fix: require dedicated appointment cancellation command 2026-10-11 14:14:51 +08:00
ouyangxq 43494cbfa3 fix: retain appointment cancellation reasons and query history 2026-10-11 13:26:00 +08:00
ouyangxq d4b72594ab test(procurement): reject receipt corrections after shipment 2026-10-10 19:52:36 +08:00
ouyangxq 15ab355dc2 fix(appointments): include destination timezone in batch preview 2026-10-10 18:37:38 +08:00
liuyihe c6471d06ff 贴标申请,仓储转运 2026-10-10 16:58:33 +08:00
liuyihe 05302490fb 贴标申请,仓储转运 2026-10-10 16:15:17 +08:00
ouyangxq 8e36bd90ef Merge remote-tracking branch 'origin/test' into test 2026-10-10 15:34:19 +08:00
ouyangxq 0ac2b849c3 feat(appointments): track forecast impacts and handling history 2026-10-10 15:33:13 +08:00
liuyihe 84864c2ecf Merge remote-tracking branch 'origin/test' into test 2026-10-10 14:47:42 +08:00
liuyihe d1b4cc9c0f 贴标申请,仓储转运 2026-10-10 14:47:31 +08:00
ouyangxq 331f750871 fix(procurement): reject unsupported purchase payload fields 2026-10-10 14:44:23 +08:00
ouyangxq 25aae44918 Merge remote-tracking branch 'origin/test' into test 2026-10-10 14:19:42 +08:00
ouyangxq 4b5b639adc feat(appointments): expose authoritative arrival forecast observations 2026-10-10 14:10:17 +08:00
ouyangxq 71111bf21b feat(appointments): discover external booking candidates through fleet boundary 2026-10-10 14:03:42 +08:00
ouyangxq 369613a2e7 test(procurement): verify pending commands and late successful receipts 2026-10-10 14:01:50 +08:00
liuyihe 12a5093b41 贴标申请,仓储转运 2026-10-10 13:48:25 +08:00
ouyangxq 721d92ac7b fix: include overlapping overnight FBA appointments in calendar 2026-10-10 12:40:35 +08:00
ouyangxq 6e1d90aafe test: cover fleet calendar authorization in integrated contracts 2026-10-10 12:33:39 +08:00
ouyangxq 3a252dfc70 feat(fleet): expose bounded origin-aware trip calendar 2026-10-10 12:15:02 +08:00
ouyangxq 83049ed9e5 feat(warehouse): provide bounded internal historical metadata batch 2026-10-10 11:52:29 +08:00
ouyangxq 46ae8ab1c6 feat(appointments): expose bounded terminal pickup calendar 2026-10-10 11:43:47 +08:00
ouyangxq 47dc9e8bf6 fix(warehouse): use location time zones for appointment scheduling 2026-10-10 11:02:49 +08:00
ouyangxq c4c1bddeec feat(appointments): unify pre-inbound planning and confirmed FBA bookings 2026-10-10 10:38:06 +08:00
ouyangxq 24f5ccf7ff feat(appointment): share pickup and receiving followups by container 2026-10-10 08:42:01 +08:00
ouyangxq 885cac13a4 test(fleet): exercise simplified intake HTTP workflow 2026-10-10 08:07:27 +08:00
ouyangxq 2c970f252d fix(lastleg): snapshot customer name for incoming cargo 2026-10-10 08:05:23 +08:00
ouyangxq 373f1b2c18 test(procurement): verify fee source recovery without duplicate debit 2026-10-10 03:43:53 +08:00
ouyangxq c0fbe2698b fix(procurement): read MySQL fulfillment timestamps with JDBC types 2026-10-10 02:42:59 +08:00
ouyangxq a973be2103 feat(procurement): implement sample fulfillment and settled fee workflow 2026-10-10 02:19:38 +08:00
ouyangxq 040f3bbd93 fix(lastleg): preserve followup timestamp on replay 2026-10-09 22:31:51 +08:00
ouyangxq 0d75e311d0 feat(lastleg): connect appointment followups and fleet intake 2026-10-09 22:04:49 +08:00
ouyangxq 1202cafadf feat(firstleg): count actionable customer customs cabinets 2026-10-09 18:14:17 +08:00
ouyangxq d11abb78ac Merge branch 'test' of http://8.163.30.128:10082/java-project/baiyue-firstleg into test 2026-10-09 17:36:25 +08:00
ouyangxq 261cdc87cb 优化 2026-10-09 17:36:24 +08:00
liuyihe 7e37770f26 贴标申请,仓储转运 2026-10-09 17:27:02 +08:00
ouyangxq 74bf0e73c5 test: prepare isolated gray domestic PDA H5 tasks without auto-picking 2026-10-09 17:21:56 +08:00
ouyangxq 023b28e31f fix(lastleg): normalize source key comparisons across MySQL collations 2026-10-09 16:31:19 +08:00
ouyangxq f6605a1ab0 fix(sql): keep return counting in clean initialization definitions 2026-10-09 16:20:50 +08:00
ouyangxq c1aaaf207a Merge remote-tracking branch 'origin/test' into test
# Conflicts:
#	lastleg-service/src/main/resources/openapi/overseas-business-v1.yaml
2026-10-09 16:13:28 +08:00
ouyangxq 3b5454fb99 feat(lastleg): query commercial sources independently of fulfillment types 2026-10-09 16:12:02 +08:00
liuyihe bac7e0b214 贴标申请,仓储转运 2026-10-09 15:53:30 +08:00
liuyihe 1e15a2838a 贴标申请,仓储转运 2026-10-09 15:25:00 +08:00
liuyihe b4b3ae452c 贴标申请,仓储转运 2026-10-09 15:20:15 +08:00
ouyangxq c4a7c2a22d feat(fleet): match cargo stops when binding dispatches 2026-10-09 15:04:51 +08:00
liuyihe 2ec5414b39 贴标申请,仓储转运 2026-10-09 11:49:17 +08:00
ouyangxq 7fd7699f6e test: verify customer isolation on shared appointment items 2026-10-09 11:10:34 +08:00
ouyangxq fddae546a0 fix: avoid existing test permission IDs for appointment menu 2026-10-09 11:05:24 +08:00
ouyangxq e94271706c feat: support shared FBA appointments and arrival calendar 2026-10-09 11:01:39 +08:00
ouyangxq 4f9433c39a test(pda): bind receiving fixtures to exact source container booking 2026-10-08 21:36:53 +08:00
ouyangxq 6b6d217774 Merge branch 'test' of http://8.163.30.128:10082/java-project/baiyue-firstleg into test 2026-10-08 20:16:30 +08:00
ouyangxq ed99ecba1c 优化 2026-10-08 19:09:30 +08:00
liuyihe 315a510969 贴标申请,仓储转运 2026-10-08 18:27:52 +08:00
ouyangxq 2c0f55d9b7 fix(config): restore required IAM Nacos imports 2026-10-08 18:18:33 +08:00
liuyihe a24a223a35 贴标申请,仓储转运 2026-10-08 18:10:06 +08:00
ouyangxq 3a9ee57e53 fix(lastleg): restore fulfillment safeguards and reconcile return regressions 2026-10-08 18:08:42 +08:00
ouyangxq c1ddb658bd 优化 2026-10-08 17:07:57 +08:00
1453 changed files with 116433 additions and 16525 deletions
+19 -3
View File
@@ -25,7 +25,7 @@
### 后端任务最小读取集
- 单服务 Controller/Service/Mapper 任务:本文件、目标服务 `AGENTS.md`、目标类及其直接调用点。
- 跨服务 API/事件任务:在上述基础上增加直接调用方、被调用方和对应 Gateway/OpenAPI;不因业务关键词自动加载整个业务专题。
- 跨服务 API/事件任务:在上述基础上增加直接调用方、被调用方及受影响的 OpenAPI/事件契约;公开路径、访问域或入口鉴权变化才增加 Gateway,内部调用和事件不经公网 Gateway。不因业务关键词自动加载整个业务专题。
- 只有状态、权限、数据库或验收边界无法从上述入口确定时,才读取 `docs/业务快速索引.md`、专题 README 或完整契约。
- 读取预算遵循工作区根指引:超过约 250 行或 8000 字符时先读职责、硬边界和验证章节,再检索任务命中段;不得仅因行数少而全文加载长业务表。聚合构建或架构任务才读取相关 `README.md`、`pom.xml` 和目录结构文档,已知单模块任务不增加概览文档。
@@ -78,6 +78,9 @@
| 国内船节点向海外接柜门禁事件 | `firstleg/`、`common-event-contract/`、`lastleg-service/` |
| 海外仓库目录、海外库位、海外托盘、资源锁 | 国内仓库目录归 `warehouse/`,海外资源归 `warehouse-overseas-service/` |
| Lastleg 内部模块化与依赖基线 | `lastleg-service/` |
| 自营领星采集、经营统计、SKU 日销量 | `lastleg-service/selfoperated/` 查询与采集编排;领星签名/分页/外部接口查 `integration-service/`,不因采集页面任务同时读取两服务 |
| 跨客户同仓预约、预约跟进、到港日历 | `lastleg-service/inboundplan/`、`appointmentplanning/`;到港事实查 `firstleg/portschedule/` |
| 车辆、司机证照、车次、外接预订、车队报价、出车记录 | `lastleg-service/fleet/`;先读 `lastleg-service/AGENTS.md` 对应入口,客户排车关联再沿 `dispatch/fleet/` 实际调用 |
| PDF 标签、审计、业务事件直投 | `print/`、`audit-service/`、`common-event-contract/` |
## 公共模块快速索引
@@ -103,9 +106,22 @@
- 装柜、船节点、卸柜、暂扣、派送、费用与资金按统一通信契约的逐事件表直接投递。保留本地 Outbox、消费幂等、重试与失败处置,不携带用户 JWT;旧 Bridge 源码已退出聚合和发布清单,退役待清理;实际停机仍须替代链验证与授权,不得据源码状态认定已部署。
- `lastleg-service` 不读取头程数据库,`warehouse-overseas-service` 不读取尾程订单库。共用测试 MySQL 实例不改变服务数据归属。准确路由、ACK、撤销矩阵和切换门槛只维护在新的两份主契约中。
## 数据库访问与中文代码注释(所有服务及公共模块强制)
- 本节适用于全部后端服务和公共模块;新增、修改的方法必须执行,触及的存量代码同步整改。登记本约束不代表存量代码已全部完成迁移和注释补齐。
- 生产代码的关系型数据库读写统一经 MyBatis/MyBatis-Plus Mapper 执行;Controller、Service、定时任务、消费者、编号生成器和公共基础组件不得直接使用 `JdbcTemplate`、`NamedParameterJdbcTemplate`、原生 JDBC/Connection/Statement 或其他通道执行 SQL。仅改成 Repository 包装 JDBC 不算整改,SQL 必须进入 Mapper;无数据库职责的模块不得为满足本条新增数据库访问。
- 正常业务数据库访问路径统一为 `Controller → Service → Repository → Mapper`,四层职责明确,不得省略 Repository,也不得由 Controller 直接调用 Repository/Mapper,或由 Service 直接调用 Mapper。定时任务、消费者等非 HTTP 入口从 Service 进入,同样经 Repository → Mapper 完成持久化访问。
- Controller 负责请求接收、参数校验、入口权限和响应转换;Service 负责业务规则、编排及业务事务;Repository 负责领域数据访问封装、查询组合与持久化模型转换,对 Service 提供有业务含义的数据操作;Mapper 负责 SQL 执行及数据库记录映射。Repository 不承载业务状态流转,不直接用 JDBC 执行 SQL;Service 不继承 MyBatis-Plus `ServiceImpl` 等方式绕过 Repository。
- 复杂查询、批量处理、原子计数、锁定读取、Outbox 和数据库监控查询同样经 Repository → Mapper,不以 SQL 特殊或实现方便为由跳层。公共模块需要数据库能力时,按现有模块边界定义 Repository/持久化接口,由所属服务的 Repository → Mapper 实现,禁止借此跨服务读库。
- 迁移数据库操作须保留客户隔离条件、事务传播、行锁、幂等和并发语义;`LAST_INSERT_ID()` 等连接级操作必须在同一事务连接完成,并明确关闭相关读取缓存,不能仅机械搬移 SQL。Mapper 注册及扫描仍遵守下文统一规范。
- 测试代码可用 `JdbcTemplate` 创建隔离测试表、准备数据及核对结果;被测生产路径仍必须调用实际 Mapper,不得把测试造数做法带入生产。数据库基线和迁移脚本按现有部署契约管理。
- 每个手写方法及构造器均须添加简短中文注释,通常 1—3 行说明业务用途;接口方法和 Mapper 方法优先使用中文 Javadoc。覆盖方法同样须有简短中文说明,实现中的关键规则仍须就地注释;自动生成的方法不手工逐个补注释。
- 核心业务、复杂 SQL、状态流转、资金与库存变更、权限隔离、事务、锁、幂等、并发、重试和补偿逻辑,须在关键代码前增加适量中文注释,解释业务规则、处理原因、约束边界及失败影响;不逐行翻译代码,不添加无信息量或与实现不符的注释。
- 新增和修改的代码说明注释统一使用中文;必要的技术标识、协议名、类名可保留原文,第三方许可证和生成标记保持原样。修改方法时同步更新相关存量英文或过期说明;审查时同时核对 Controller → Service → Repository → Mapper 分层及中文方法、核心逻辑注释。
## 契约、数据库与验证入口
- 对外 Controller/API 新增、改名或删除时,同时核对调用端、区域 Gateway、OpenAPI 和权限;提交前运行 `node --test scripts/gateway-route-contract.test.mjs`,自动发现生产 Controller 并校验网关目标服务与内部路径隔离。失败不得提交或标记完成;网关配置变化必须列入部署清单,不以业务服务单测代替入口检查。
- 对外 Controller/API 新增、改名或删除时,同时核对调用端、统一 Gateway、OpenAPI 和权限;提交前运行 `node --test scripts/gateway-route-contract.test.mjs`,自动发现生产 Controller 并校验网关目标服务与内部路径隔离。失败不得提交或标记完成;网关配置变化必须列入部署清单,不以业务服务单测代替入口检查。
- 跨服务修改先检查调用方 `client/`、被调用方 Controller/DTO、`src/main/resources/openapi/` 和双方契约测试;禁止共享领域 Entity。
- 修改 Java 方法、构造器、Controller、Client、DTO 或 Mapper 参数签名时,先用 `rg` 定向查找符号及旧参数形态,并同步更新 `src/main/`、`src/test/`、Mock、Fixture、契约测试和脚本中的全部调用点。新增可选参数也必须补齐旧测试调用,不能因生产调用已更新就视为完成。
@@ -140,7 +156,7 @@
- 订单与客户:`../docs/订单与客户/README.md`、`../docs/订单与客户/订单与客户头程订单闭环设计.md`
- 入库测量与计费:`../docs/入库测量与计费/README.md`;流程细节按 `../docs/头程到尾程/README.md` 指向的当前阶段文档读取,需求确认和联调报告仅在历史追溯或验收证据任务中读取
- 国内货柜履约:`../docs/国内货柜履约/README.md`、`../docs/国内货柜履约/报关资料与船期价格接入梳理.md`;开发规划、开工门禁、需求确认和验收材料已归档,只有历史追溯或验收证据任务才读取
- 国内货柜履约:`../docs/国内货柜履约/README.md`,报关规则变化再查 `../docs/国内货柜履约/报关资料与船期价格接入梳理.md`。规划、确认与验收材料按归档位置及文档角色判断,当前入口指定的有效规则仍按需核对,历史材料只用于追溯或证据任务
- 海外仓业务:`../docs/海外仓业务/README.md`;统一入口 `gateway/`,尾程与入仓库存 `lastleg-service/`,海外仓储资源 `warehouse-overseas-service/`
- 海外仓全流程:以正式 Controller、前端路由、权限、SQL 与跨区事件契约为范围依据;海外接柜、入仓、库存、库内服务、排车、出库、派送、一件代发、异常退回和客户回访进入 `lastleg-service/`,国内 SKU/箱唛及暂扣协同进入 `order/`、`firstleg/`、`common-event-contract/`
- 财务:`../docs/财务管理/README.md` 中已确认的范围、对象、状态和接口约束
Vendored
+5 -2
View File
@@ -161,7 +161,7 @@ pipeline {
choice(name: 'ENVIRONMENT', choices: environmentChoicesForJob(env.JOB_BASE_NAME), description: '部署环境')
booleanParam(name: 'DEPLOY', defaultValue: false, description: '各服务构建成功后是否独立部署')
booleanParam(name: 'SKIP_TESTS', defaultValue: false, description: '是否跳过测试执行(仍编译测试源码)')
string(name: 'IMAGE_REPOSITORY', defaultValue: 'registry.example.com/team/baiyue-firstleg', description: '共享镜像仓库地址')
string(name: 'IMAGE_REPOSITORY', defaultValue: '', description: '必须填写已核实的共享镜像仓库地址 host[:port]/owner/image')
string(name: 'DOCKER_BASE_IMAGE', defaultValue: 'eclipse-temurin:17-jre-alpine', description: 'Java 17 基础镜像')
choice(name: 'DOWNSTREAM_JOB_PREFIX', choices: downstreamJobPrefixChoicesForJob(env.JOB_BASE_NAME), description: '由当前总控 Job 固定的单服务 Job 前缀')
}
@@ -190,9 +190,12 @@ pipeline {
String requestedRepository = params.IMAGE_REPOSITORY?.trim()
if (!requestedRepository || requestedRepository == 'registry.example.com/your-group/baiyue-firstleg') {
if (!requestedRepository) {
error('必须填写真实镜像仓库地址')
}
if (requestedRepository.tokenize('/')[0] ==~ /(?i)(?:[a-z0-9-]+\.)*example\.(?:com|net|org)(?::[0-9]+)?/) {
error('IMAGE_REPOSITORY 不能使用 example 示例域名,请填写已核实的镜像仓库地址')
}
if (requestedRepository.contains('://') || !requestedRepository.contains('/')) {
error('IMAGE_REPOSITORY 格式错误:请填写 host[:port]/owner/image,不要包含 http:// 或 https://')
}
+4 -1
View File
@@ -49,7 +49,7 @@ pipeline {
booleanParam(name: 'ALLOW_SAME_CONTRACT_ROLLBACK', defaultValue: false, description: '仅确认相同协议与Schema时允许回滚;架构切换保持关闭')
booleanParam(name: 'DEPLOY', defaultValue: false, description: '构建成功后是否部署本服务')
booleanParam(name: 'SKIP_TESTS', defaultValue: false, description: '是否跳过测试')
string(name: 'IMAGE_REPOSITORY', defaultValue: 'registry.example.com/team/baiyue-firstleg', description: '共享镜像仓库基础路径,不包含服务名和标签')
string(name: 'IMAGE_REPOSITORY', defaultValue: '', description: '必须填写已核实的共享镜像仓库基础路径,不包含服务名和标签')
string(name: 'DOCKER_BASE_IMAGE', defaultValue: 'eclipse-temurin:17-jre-alpine', description: 'Java 17 基础镜像')
}
@@ -101,6 +101,9 @@ pipeline {
if (!imageRepository || imageRepository.contains('://')) {
error('IMAGE_REPOSITORY 不能为空且不能包含协议前缀')
}
if (imageRepository.tokenize('/')[0] ==~ /(?i)(?:[a-z0-9-]+\.)*example\.(?:com|net|org)(?::[0-9]+)?/) {
error('IMAGE_REPOSITORY 不能使用 example 示例域名,请填写已核实的镜像仓库地址')
}
if (!imageRepository.contains('/')) {
error('IMAGE_REPOSITORY 必须使用 host[:port]/owner/image 格式')
}
+5
View File
@@ -1,5 +1,10 @@
# Audit Service 模块指引
## 数据库访问与中文注释约束
- 强制遵守根 `../AGENTS.md` 的“数据库访问与中文代码注释”全部规则:正常业务访问统一为 `Controller → Service → Repository → Mapper`,不得省略 Repository 或跨层直调;生产 SQL 由 Mapper 执行,Repository 不得直接使用 JdbcTemplate 或原生 JDBC。非 HTTP 入口从 Service 进入;无数据库模块不引入数据库访问。
- 每个手写方法及构造器须有简短中文说明;核心业务规则、复杂 SQL、事务、锁、幂等、并发及失败处理须补充适量中文注释,重点说明原因和边界。新增、修改方法立即执行,触及的存量代码同步整改。
## 职责边界
- Mapper 只由 `BaiyueAuditApplication.java` 对 `com.baiyue.audit` 根包按 `@Mapper` 过滤扫描;新增或移动 Mapper 后从后端根运行 `node scripts/mapper-scan-contract.mjs`,不得增加子域扫描配置。
+5
View File
@@ -1,5 +1,10 @@
# Auth Service 模块指引
## 数据库访问与中文注释约束
- 强制遵守根 `../AGENTS.md` 的“数据库访问与中文代码注释”全部规则:正常业务访问统一为 `Controller → Service → Repository → Mapper`,不得省略 Repository 或跨层直调;生产 SQL 由 Mapper 执行,Repository 不得直接使用 JdbcTemplate 或原生 JDBC。非 HTTP 入口从 Service 进入;无数据库模块不引入数据库访问。
- 每个手写方法及构造器须有简短中文说明;核心业务规则、复杂 SQL、事务、锁、幂等、并发及失败处理须补充适量中文注释,重点说明原因和边界。新增、修改方法立即执行,触及的存量代码同步整改。
## 职责与边界
- Mapper 只由 `BaiyueAuthApplication.java` 对 `com.baiyue.auth` 根包按 `@Mapper` 过滤扫描;新增或移动 Mapper 后从后端根运行 `node scripts/mapper-scan-contract.mjs`,不得增加子域扫描配置。
+5
View File
@@ -1,5 +1,10 @@
# Common Audit 模块指引
## 数据库访问与中文注释约束
- 强制遵守根 `../AGENTS.md` 的“数据库访问与中文代码注释”全部规则:正常业务访问统一为 `Controller → Service → Repository → Mapper`,不得省略 Repository 或跨层直调;生产 SQL 由 Mapper 执行,Repository 不得直接使用 JdbcTemplate 或原生 JDBC。非 HTTP 入口从 Service 进入;无数据库模块不引入数据库访问。
- 每个手写方法及构造器须有简短中文说明;核心业务规则、复杂 SQL、事务、锁、幂等、并发及失败处理须补充适量中文注释,重点说明原因和边界。新增、修改方法立即执行,触及的存量代码同步整改。
## 职责边界
- 负责业务审计事件采集、注解切面、敏感字段脱敏以及日志/HTTP 输出。
+5
View File
@@ -1,5 +1,10 @@
# Common Core 模块指引
## 数据库访问与中文注释约束
- 强制遵守根 `../AGENTS.md` 的“数据库访问与中文代码注释”全部规则:正常业务访问统一为 `Controller → Service → Repository → Mapper`,不得省略 Repository 或跨层直调;生产 SQL 由 Mapper 执行,Repository 不得直接使用 JdbcTemplate 或原生 JDBC。非 HTTP 入口从 Service 进入;无数据库模块不引入数据库访问。
- 每个手写方法及构造器须有简短中文说明;核心业务规则、复杂 SQL、事务、锁、幂等、并发及失败处理须补充适量中文注释,重点说明原因和边界。新增、修改方法立即执行,触及的存量代码同步整改。
## 职责边界
- 提供不依赖具体业务域的返回模型、异常、基础实体和 MyBatis-Plus 通用配置。
+5
View File
@@ -1,5 +1,10 @@
# Common Event Contract 模块指引
## 数据库访问与中文注释约束
- 强制遵守根 `../AGENTS.md` 的“数据库访问与中文代码注释”全部规则:正常业务访问统一为 `Controller → Service → Repository → Mapper`,不得省略 Repository 或跨层直调;生产 SQL 由 Mapper 执行,Repository 不得直接使用 JdbcTemplate 或原生 JDBC。非 HTTP 入口从 Service 进入;无数据库模块不引入数据库访问。
- 每个手写方法及构造器须有简短中文说明;核心业务规则、复杂 SQL、事务、锁、幂等、并发及失败处理须补充适量中文注释,重点说明原因和边界。新增、修改方法立即执行,触及的存量代码同步整改。
## 职责边界
- 维护 Firstleg、Lastleg、Finance 之间稳定、可版本化的业务事件契约。
@@ -56,6 +56,7 @@ public record BusinessFeeSourceChangedV1(
String reviewStatus,
String publicationStatus,
String sourceStatus,
String sourceHash
String sourceHash,
WalletSettlementReference walletSettlement
) {
}
@@ -15,7 +15,9 @@ public record WalletCommandCompletedV1(
BigDecimal amount,
String errorCode,
String errorMessage,
Instant completedAt
Instant completedAt,
String walletHoldId,
String walletLedgerId
) {
public static final int VERSION = 1;
}
@@ -3,7 +3,13 @@ package com.baiyue.common.event;
import java.math.BigDecimal;
import java.time.Instant;
/** 海外业务向国内 Finance 发起的客户资金冻结、结算或释放指令。 */
/**
* 海外业务向 Finance 发起的客户资金指令。
* FREEZE 的 amount 为预留金额;SETTLE 全额结算;RELEASE 释放原冻结。
* SETTLE_ACTUAL 的 amount 为最终正额 CNY 实扣,原子补差或释放余款,原冻结金额保留。
* 实际零元使用 RELEASE,不发送零元结算。结算和释放按原业务冻结身份关联。
* REFUND 使用独立业务退款号并携带 originalLedgerId,关联原成功消费,不创建充值。
*/
public record WalletCommandRequestedV1(
String operation,
long customerId,
@@ -12,7 +18,8 @@ public record WalletCommandRequestedV1(
BigDecimal amount,
String remark,
String idempotencyKey,
Instant requestedAt
Instant requestedAt,
String originalLedgerId
) {
public static final int VERSION = 1;
}
@@ -0,0 +1,4 @@
package com.baiyue.common.event;
/** Finance-issued identity of a successful consumption, carried by its immutable fee source. */
public record WalletSettlementReference(String commandEventId, String holdId, String ledgerId) { }
+5
View File
@@ -1,5 +1,10 @@
# Common OpenAPI 模块指引
## 数据库访问与中文注释约束
- 强制遵守根 `../AGENTS.md` 的“数据库访问与中文代码注释”全部规则:正常业务访问统一为 `Controller → Service → Repository → Mapper`,不得省略 Repository 或跨层直调;生产 SQL 由 Mapper 执行,Repository 不得直接使用 JdbcTemplate 或原生 JDBC。非 HTTP 入口从 Service 进入;无数据库模块不引入数据库访问。
- 每个手写方法及构造器须有简短中文说明;核心业务规则、复杂 SQL、事务、锁、幂等、并发及失败处理须补充适量中文注释,重点说明原因和边界。新增、修改方法立即执行,触及的存量代码同步整改。
## 职责边界
- 为 Spring MVC 服务提供 SpringDoc/OpenAPI 自动配置和统一文档元数据。
+5
View File
@@ -1,5 +1,10 @@
# Common Security 模块指引
## 数据库访问与中文注释约束
- 强制遵守根 `../AGENTS.md` 的“数据库访问与中文代码注释”全部规则:正常业务访问统一为 `Controller → Service → Repository → Mapper`,不得省略 Repository 或跨层直调;生产 SQL 由 Mapper 执行,Repository 不得直接使用 JdbcTemplate 或原生 JDBC。非 HTTP 入口从 Service 进入;无数据库模块不引入数据库访问。
- 每个手写方法及构造器须有简短中文说明;核心业务规则、复杂 SQL、事务、锁、幂等、并发及失败处理须补充适量中文注释,重点说明原因和边界。新增、修改方法立即执行,触及的存量代码同步整改。
## 职责边界
- 提供业务服务通用的 JWT 解码、认证过滤、Redis Access Token 会话校验、认证用户上下文及 401/403 JSON 响应。
+5
View File
@@ -1,5 +1,10 @@
# Common Web 模块指引
## 数据库访问与中文注释约束
- 强制遵守根 `../AGENTS.md` 的“数据库访问与中文代码注释”全部规则:正常业务访问统一为 `Controller → Service → Repository → Mapper`,不得省略 Repository 或跨层直调;生产 SQL 由 Mapper 执行,Repository 不得直接使用 JdbcTemplate 或原生 JDBC。非 HTTP 入口从 Service 进入;无数据库模块不引入数据库访问。
- 每个手写方法及构造器须有简短中文说明;核心业务规则、复杂 SQL、事务、锁、幂等、并发及失败处理须补充适量中文注释,重点说明原因和边界。新增、修改方法立即执行,触及的存量代码同步整改。
## 职责边界
- 提供 Servlet Web 通用能力:请求链路标识、上下文和统一异常响应。
+81
View File
@@ -123,4 +123,85 @@ baiyue:
max-rows: 200000
max-attempts: 3
batch-size: 500
LAST_MILE_ORDER_LIST:
provider-service: lastleg-service
provider-path: /internal/exports/v1/LAST_MILE_ORDER_LIST/batches
required-permission: platform:overseas-warehouse:last-mile-order:export
app-scope: PLATFORM
enabled: true
max-rows: 200000
max-attempts: 3
batch-size: 200
OVERSEAS_INVENTORY_BALANCE:
provider-service: lastleg-service
provider-path: /internal/exports/v1/OVERSEAS_INVENTORY_BALANCE/batches
required-permission: platform:overseas-warehouse:inventory:export
app-scope: PLATFORM
enabled: true
max-rows: 200000
max-attempts: 3
batch-size: 200
SELFOP_INVENTORY_TURNOVER:
provider-service: lastleg-service
provider-path: /internal/exports/v1/SELFOP_INVENTORY_TURNOVER/batches
required-permission: platform:self-operated-analytics:export
app-scope: PLATFORM
enabled: true
max-rows: 200000
max-attempts: 3
batch-size: 100
OVERSEAS_INVENTORY_LEDGER:
provider-service: lastleg-service
provider-path: /internal/exports/v1/OVERSEAS_INVENTORY_LEDGER/batches
required-permission: platform:overseas-warehouse:inventory:export
app-scope: PLATFORM
enabled: true
max-rows: 200000
max-attempts: 3
batch-size: 200
OVERSEAS_QUOTE_LIST:
provider-service: lastleg-service
provider-path: /internal/exports/v1/OVERSEAS_QUOTE_LIST/batches
required-permission: platform:overseas-master-data:quote:export
app-scope: PLATFORM
enabled: true
max-rows: 200000
max-attempts: 3
batch-size: 200
MONTHLY_EXCHANGE_RATE_LIST:
provider-service: lastleg-service
provider-path: /internal/exports/v1/MONTHLY_EXCHANGE_RATE_LIST/batches
required-permission: platform:overseas-master-data:exchange-rate:export
app-scope: PLATFORM
enabled: true
max-rows: 200000
max-attempts: 3
batch-size: 200
VEHICLE_LIST:
provider-service: lastleg-service
provider-path: /internal/exports/v1/VEHICLE_LIST/batches
required-permission: platform:overseas-master-data:vehicle:export
app-scope: PLATFORM
enabled: true
max-rows: 200000
max-attempts: 3
batch-size: 200
FLEET_QUOTE_LIST:
provider-service: lastleg-service
provider-path: /internal/exports/v1/FLEET_QUOTE_LIST/batches
required-permission: platform:fleet:quote:export
app-scope: PLATFORM
enabled: true
max-rows: 200000
max-attempts: 3
batch-size: 200
TRIP_OPERATIONS_LIST:
provider-service: lastleg-service
provider-path: /internal/exports/v1/TRIP_OPERATIONS_LIST/batches
required-permission: platform:fleet:operations:export
app-scope: PLATFORM
enabled: true
max-rows: 200000
max-attempts: 3
batch-size: 200
baiyue.clients.finance.url: ${FINANCE_SERVICE_URL:}
+19
View File
@@ -218,6 +218,12 @@ services:
environment:
<<: *common-environment
SERVER_PORT: 9210
LINGXING_WMS_ENABLED: ${LINGXING_WMS_ENABLED:-false}
LINGXING_COLLECTION_MODE: ${SELFOP_COLLECTION_MODE:-OFF}
LINGXING_ENVIRONMENT_LABEL: ${DEPLOY_ENV:-test}
LINGXING_SOURCE_ACCOUNT: ${SELFOP_SOURCE_ACCOUNT:-lingxing-primary}
LINGXING_OMS_APP_KEY: ${LINGXING_OMS_APP_KEY:-}
LINGXING_OMS_APP_SECRET: ${LINGXING_OMS_APP_SECRET:-}
BAIDU_OCR_ENABLED: ${BAIDU_OCR_ENABLED:-false}
BAIDU_OCR_API_KEY: ${BAIDU_OCR_API_KEY:-}
BAIDU_OCR_SECRET_KEY: ${BAIDU_OCR_SECRET_KEY:-}
@@ -279,9 +285,20 @@ services:
image: ${IMAGE_REPOSITORY}/lastleg-service:${IMAGE_TAG}
container_name: firstleg-${DEPLOY_ENV:-test}-lastleg
expose: ["9303"]
# 仅限制尾程服务,避免 JVM 异常时拖垮测试服务器.
mem_limit: 3g
memswap_limit: 3g
cpus: "2.0"
environment:
<<: *common-environment
SERVER_PORT: 9303
JAVA_TOOL_OPTIONS: "-Xms512m -Xmx1536m -XX:+ExitOnOutOfMemoryError -Dfile.encoding=UTF-8"
SELFOP_EXECUTION_ENABLED: ${SELFOP_EXECUTION_ENABLED:-false}
SELFOP_COLLECTION_MODE: ${SELFOP_COLLECTION_MODE:-OFF}
SELFOP_SOURCE_ACCOUNT: ${SELFOP_SOURCE_ACCOUNT:-lingxing-primary}
SELFOP_DAILY_REQUEST_BUDGET: ${SELFOP_DAILY_REQUEST_BUDGET:-0}
SELFOP_MIN_REQUEST_INTERVAL_MS: ${SELFOP_MIN_REQUEST_INTERVAL_MS:-5000}
SELFOP_SALES_PUBLICATION_ENABLED: ${SELFOP_SALES_PUBLICATION_ENABLED:-false}
EVENT_CONNECT_TIMEOUT_MS: ${EVENT_CONNECT_TIMEOUT_MS:-3000}
EVENT_READ_TIMEOUT_MS: ${EVENT_READ_TIMEOUT_MS:-15000}
EVENT_LEASE_SECONDS: ${EVENT_LEASE_SECONDS:-60}
@@ -321,3 +338,5 @@ networks:
infra-network:
external: true
name: ${INFRA_NETWORK:-firstleg-${DEPLOY_ENV:-test}-infra-network}
+10
View File
@@ -21,6 +21,16 @@ IMAGE_TAG=
FILE_UPLOADS_HOST_DIR=/data/firstleg/uploads
CORS_ALLOWED_ORIGINS=
INTERNAL_SERVICE_TOKEN=
# 领星唯一账号;凭据仅注入 integration-service。
LINGXING_OMS_APP_KEY=
LINGXING_OMS_APP_SECRET=
LINGXING_WMS_ENABLED=false
SELFOP_COLLECTION_MODE=OFF
SELFOP_SOURCE_ACCOUNT=lingxing-primary
# 未核准额度使用0,真实出口拒绝请求;有效模式仍需显式的独占交接证明与截止时间。
SELFOP_DAILY_REQUEST_BUDGET=0
SELFOP_MIN_REQUEST_INTERVAL_MS=5000
SELFOP_SALES_PUBLICATION_ENABLED=false
REDIS_PASSWORD=
AUTH_DB_URL=jdbc:mysql://host.docker.internal:3306/baiyue_auth?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai
AUTH_DB_USERNAME=
@@ -0,0 +1,63 @@
# 2026-10-16 拉取合并数据库变更汇总
范围:IDEA 更新前暂存基点 `cda5f3dc3` 到远程 `test` 的 `4e2ea8940`,加上本次恢复的本地改动。不是任意历史版本的一键全量升级脚本。没有连接或执行实际数据库。
## 数据库对应关系
| 服务 | 数据库 | 本次处理 |
|---|---|---|
| lastleg-service | `baiyue_lastleg` | 执行下列 V28 增量,新增表、字段、索引并放宽四个字段的可空性 |
| warehouse-overseas-service | `baiyue_lastlag_warehouse` | 仅业务代码变化,无新增表或字段,无需 SQL;数据库名称保留正式的 lastlag 拼写 |
| 其他服务 | 各服务原数据库 | 本次比较范围内无 SQL 结构新增,无需 SQL |
已有尾程库使用:[V28 可重复执行 SQL](migrations/overseas/baiyue_lastleg/V28__merge_transfer_measurement_and_compact_numbers.sql)。文件显式指定 `USE baiyue_lastleg`,不访问其他服务数据库。
## 新表与字段
| 表 | 字段 | 定义/用途 |
|---|---|---|
| `ll_compact_number_clock`(新表) | `number_key` | VARCHAR(16),主键,业务前缀及客户名称缩写 |
| 同上 | `last_second` | BIGINT NOT NULL,短单号分配逻辑秒,防止同秒及多实例重号 |
| `ll_warehouse_transfer_item` | `declared_quantity` | BIGINT NULL,SKU 申报件数,独立于箱数 |
| `ll_warehouse_transfer_carton` | `length_cm`、`width_cm`、`height_cm`、`gross_weight_kg` | DECIMAL(12,2) NULL,逐箱实测尺寸、重量 |
| 同上 | `counted_quantity` | BIGINT NULL,实点 SKU 件数 |
| 同上 | `count_idempotency_key` | VARCHAR(255) NULL,清点幂等键 |
| 同上 | `count_request_hash` | VARCHAR(64) NULL,清点请求摘要 |
| 同上 | `counted_by` | VARCHAR(128) NULL,清点操作人 |
| 同上 | `counted_at` | DATETIME(3) NULL,清点时间 |
| 同上 | `discrepancy_reason` | VARCHAR(1000) NULL,实收差异原因 |
| 同上 | `transfer_pallet_id` | BIGINT NULL,所属转运托盘事实 ID |
| 同上 | `sku_items_json` | JSON NULL,一箱多 SKU 清点明细 |
| 同上 | `customer_carton_mark` | VARCHAR(255) NULL,客户原箱唛及现场换标绑定 |
合计:1 张新表(2 列)、既有表补齐 14 列。逐箱清点等字段在旧版独立增量中已有,本次合并统一纳入 V28,避免漏执行;已存在的列会跳过。
## 索引及既有字段调整
| 表 | 调整 |
|---|---|
| `ll_cargo_discard_item` | 缺失时增加普通索引 `idx_ll_cargo_discard_return_carton(customer_id,return_carton_id)` |
| `ll_warehouse_transfer_order` | `estimated_arrival_at` 改为 DATETIME(3) NULL,库存转运无需填写预计入仓时间 |
| `ll_delivery_order` | `total_volume_cbm` 改为 DECIMAL(18,4) NULL,未知体积保持空值 |
| `ll_outbound_order`、`ll_outbound_pallet_item` | `volume_cbm` 改为 DECIMAL(18,4) NULL,未知体积保持空值 |
远程同时完善了 `ll_relabel_application.delivery_method` 的业务说明及照片、预约表的中文注释,没有新增对应字段,不需要因此另建表。照片回显和箱子订单归属校验复用已有结构。
## 执行与重跑
1. 确认连接为需要升级的 MySQL 8 实例,已有 `baiyue_lastleg` 及之前版本的业务表。通过数据库客户端打开并完整执行 V28,失败时停止,不启用忽略错误继续执行。
2. 新表采用 `CREATE TABLE IF NOT EXISTS`;每个新增字段和索引单独检查 `information_schema`,部分完成后可重跑。四个可空字段仅在当前为 NOT NULL 时调整。不会回填、删除或重算历史业务数据。
3. DDL 在 MySQL 中会自动提交,不能整体事务回滚;脚本不会修复同名但定义不一致的已有列、索引或新表,执行前应核对这些对象的结构。脚本末尾提供字段结构查询。
4. 此前 V1–V27 和其他已发布增量仍按原版本顺序管理,V28 不替代它们;缺失整个业务表的旧库应先完成对应历史升级。
空库使用原有海外统一初始化入口,已同步最终建表结构与 209 张表计数。名称含“增量”的海外统一文件仍仅用于空库,不应向已有业务库执行。
## 本地合并记录
远程分支已拉取,当前本地 HEAD 与 `origin/test` 一致。本次异常来自 IDEA 恢复更新前暂存补丁不完整;48 个文件按当前文件、原始基点、暂存内容做三方合并。唯一文本冲突保留远程 `bindingGuard` 与本地 `compactNumbers` 两项测试依赖初始化。
恢复前文件及三方版本保存在 `D:/project/.codex-temp/pull-resolution-20261016`;IDEA 原 shelf 保留。没有自动提交或推送代码。
本地验证:相关业务 Maven 定向测试通过;初始化基线、入库费用/扣货及网关路由合同共 27 项通过;Git 无未解决索引、无残留冲突标记,差异格式检查通过。SQL 仅完成离线核对,未进行 MySQL 实库执行或二次重跑验证。
指引索引检查 `scripts/agents-index-contract.ps1` 因工作区缺少 `D:/project/docs/业务快速索引.md` 而中止,此项未通过;未为消除检查错误而创建替代业务文档。
+52 -5
View File
@@ -1,19 +1,58 @@
# 单测试环境数据库空库初始化
排车整车作业结构同步于 Lastleg 源基线及海外统一空库基线:整车主单移除客户头部,真实客户归属保留在货物、出库、派送和费用;新增公共命令账本、主单历史、派送安排及签收待汇总信号。空排车的计划时间可暂缺,提交审核前由业务校验补齐;`ll_dispatch_physical_pallet_lock` 独立保存无代表客户的实托排他占用,`ll_dispatch_pallet_lock.physical_lock_id` 关联逐客户逻辑来源,同车可共享、跨主单或草稿容器仍排他。`ll_dispatch_item` 按主单和完整来源键唯一,`ll_dispatch_item_source` 冻结换标明细的实际位置、绑定箱数、真实件数(未知为空)及原货源事实;拣货归属新增 `dispatch_item_source_id`,与实收、退回实收、原生退货箱三类凭据四者互斥,不伪造普通收货凭据。智能草稿按拥有者、起运仓和版本维护,一容器转换一整车;独立草稿命令保存原请求和结果。必须与匹配的 Lastleg、IAM、File、Admin 和 PDA 一起核对,空库脚本不能向已有 TEST 重放。本条仅说明代码基线,不表示 SQL 已执行、已部署或全流程已验收;唯一业务规则见工作区 `docs/海外仓业务/排车列表统一作业改造契约.md`。
`ll_physical_pallet_guard` 以真实全局实托ID和首次创建时间提供排车冻结与仓内改托的共同串行点,独立于运输占用,不保存客户、状态、有效期或第三种拥有者。`ll_dispatch_item_source.relabel_round_key`保存真实作业轮次,不能把扫码引起的库存和申请状态变化误当作换标轮次变化。排车、草稿和仓内调用必须使用匹配的公共锁实现;本条只说明空库基线结构,不表示已执行或已部署。
本土散板简化下单的当前结构同步于 Lastleg 源基线及海外统一空库基线:移除散板柜型与旧要求日期,增加商品名称、申报预计托数及当地取货/送达时间,移除运输方式,增加起运地及目的地各自的联系人和联系电话;四项联系信息、取货及送货时间均必填;打盘与运输安排允许未知。预计托数不代表实收。字段语义唯一见工作区 `docs/海外仓业务/README.md`,不回填测试存量,不提供自动重置或启动时 SQL;需与匹配 Lastleg、Admin 和 Client 一起发布。本说明不表示 SQL 已执行。
`migrations/overseas/baiyue_lastleg/V23__align_return_movement_collation.sql` 将退货进销存 UNION 涉及的八张表、22 个文本字段及表默认规则显式统一为 `utf8mb4_unicode_ci`,同步 Lastleg 两份源基线与海外统一空库基线。执行前核对字段长度、默认值、可空性及目标规则下唯一索引无冲突;只修改规则,不回填或删除数据,不重放空库基线。DDL 非事务,失败时停止并复查实际已完成项;可按最终定义重跑。脚本存在不表示测试库已执行,执行后用原始计数/分页查询验证,无需发布查询转换代码。
`migrations/overseas/baiyue_lastleg/V22__selfop_warehouse_daily_sales.sql` 新增自营仓库每日汇总表及销量版本 `warehouse_daily_ready` 标记。与匹配 Lastleg 一起发布;汇总随 SKU 日事实批次原子构建,完整性验证后方可发布。已有未构建汇总的销量版本须重新构建发布,不回填旧版本、不回退旧查询;空版本同样必须有就绪证据。源基线与海外空库基线同步。
`migrations/overseas/baiyue_lastleg/V21__procurement_fee_confirmation_origin.sql` 增加采购费用核定入口,区分业务节点与财务操作,用于独立新增费用、替代核定及其重试权限。同步源基线和海外统一空库基线;不回填测试存量,不表示已执行。
`migrations/overseas/baiyue_lastleg/V20__procurement_exception_control.sql` 增加采购事实更正/阻断说明、异常关闭及逐来源最终去向三表。服务端保持原收货和发运记录,关闭不产生库存、退款或退货运输;需与采购详情聚合和节点阻断校验的匹配版本发布。源基线和海外统一基线同步,本文件存在不表示已执行。
`migrations/overseas/baiyue_lastleg/V19__procurement_fee_correction.sql` 保存费用链修正目标、原汇率及确认前净实扣,并关联逐笔正差额/退款费用。同步进入 Lastleg 源基线与海外统一空库基线,不新增资金账本,不重算或回填旧消费;只有匹配版本能够发送本次费用链请求。本文件存在不代表已执行。
采购实物与运输结构分别见 `migrations/overseas/baiyue_lastleg/V17__procurement_physical_facts.sql` 和 `V18__procurement_transport_facts.sql`:V17 保存分次实收、差异、装箱及两段整批交寄七表;V18 保存面单版本、逐箱贴单、预估核对和一对一换包装四表,并补齐采购附件的 LABEL/PURCHASE/BUDGET/EXCEPTION 分类约束。源基线及海外统一空库基线同步,节点权限统一维护于采购 V5 权限脚本。File 同时发布对应文件类型约束;不补写历史收货、装箱或发运事实,不代表已执行或已验收。
采购购买节点结构使用 `migrations/overseas/baiyue_lastleg/V16__procurement_purchase_facts.sql`,新增单批履约事实、节点幂等审计及预算授权历史三表。独立购买/取消权限使用 `migrations/cn/baiyue_iam/V5__procurement_node_permissions.sql`,源种子为 IAM `procurement-permissions.sql`,同步进入国内统一空库基线;只给现有平台管理员角色默认授权,不新增岗位。上述结构与权限必须随采购节点匹配版本发布,不补造旧订单购买事实,不代表已执行或已验收。
`migrations/overseas/baiyue_lastleg/V15__procurement_fee_versions.sql` 为采购费用增加用途、确认版本、原币汇率、原冻结及实际流水引用,并建立 `ll_procurement_wallet_attempt` 保存每次资金请求及最终结果。零元费用可以落核定事实但不生成资金命令;字段和约束与源基线、海外统一空库基线同步。执行前核对新增列、索引和表均未存在,先发布准备完整匹配版本;不回填旧费用、不释放或重扣测试存量。该脚本仅完成费用结构,后续履约表按相应变更单独核对。
`migrations/overseas/baiyue_lastleg/V14__procurement_wallet_reference.sql` 为采购已实扣费用来源新增 `wallet_settlement` JSON 引用,保存 Finance 原资金命令、冻结及消费流水身份。源基线与海外统一空库基线同步维护;指定测试环境执行前核对列不存在,不回填历史费用,不重新收费。需与 Finance 资金回执、费用关联及 Lastleg 采购生产端的匹配版本一起发布;本文件存在不表示已经执行。
`reset-test-fba-appointments.sql` 仅用于明确授权的 TEST 预约模型重建:删除并按当前基线重建 `ll_inbound_fba_appointment`、`ll_inbound_fba_appointment_item`,并首次创建 `ll_fba_appointment_command` 保存同事务幂等结果与历史。执行任何DROP前必须确认命令表尚不存在;若已存在,先核对上次执行结果,本脚本不清空命令历史、不支持盲目重试。它会丢弃旧预约及关联明细,但不修改订单、入仓计划、库存和排车。调用者必须核对测试连接及两张表的具体重置授权;不得作为自动启动脚本或用于生产。主单区分计划日期/时段、系统单号、外部确认号和确认UTC/IANA时区;明细按稳定货源占用,不再依赖入仓计划明细。结构必须与匹配Lastleg和Admin一同发布,失败立即停止,不回填旧数据。权限从IAM种子核对;文件存在不表示已执行。
`migrations/overseas/baiyue_lastleg/V13__widen_inbound_plan_creation_mode.sql` 仅将 `ll_inbound_plan.creation_mode` 从旧统一基线的 `VARCHAR(16)` 扩至模块基线已有的 `VARCHAR(32)`,容纳实际来货审核写入的 `WAREHOUSE_TRANSFER`(18字符)。保留 `utf8mb4_unicode_ci`、非空及 `AUTO` 默认值;不更新已有计划或状态。执行前核对目标库该列的长度、排序规则、可空性和默认值,已符合最终定义则核对后跳过;执行结果不确定时先只读复查,不盲目重试。统一空库基线同步最终定义,不重放模块历史初始化脚本。
`migrations/overseas/baiyue_lastleg/V12__preserve_unknown_pool_order_fields.sql` 仅放开散板打盘需求及两类本土订单柜型三列为空、默认空,供未提供这些事实的拼车商业订单使用;普通订单输入校验仍由原服务端请求合同执行。对应源及统一空库基线同步最终定义,不回填已生成订单或把托盘数量解释成打盘服务需求。
内部拼车需求池的当前结构在 Lastleg 源基线和海外统一空库基线同步维护,独立五项权限在 IAM 源种子和国内统一基线维护。已存在基础表的指定环境结构补齐使用 `migrations/overseas/baiyue_lastleg/V10__fleet_capacity_pool.sql` 与 `migrations/cn/baiyue_iam/V4__fleet_capacity_offer_permissions.sql`;执行前确认三张新表、六个新增字段均未存在,并单独核对目标环境。随后 `V11__align_capacity_pool_collation.sql` 将预订与商业桥的客户关联字段显式统一为 `utf8mb4_unicode_ci`,与原订单域一致,避免依赖MySQL实例默认排序规则导致JOIN失败。它们不回填、删除或重置业务数据,不能重放整个空库基线。候选文件存在不表示已经执行。
平台自营领星统计十张 `ll_selfop_*` 表直接同步 Lastleg 源基线及海外统一空库基线;时间使用 UTC 存储及已确认北京时间业务日,数量使用 DECIMAL 保留 PCS 精度,维持独立发布版本。包含账号共享预算/冷却、验证根用途与硬预算、TEST BUSINESS 根会话持久预算、稳定任务号、阶段进度/心跳和旧版替代时间;任务的 `business_root_task_id` 标记共享根,只有根保存 `business_budget_json`,生产任务不使用该测试预算。库存 run 包含每日代表日期、选择规则及账号/仓库/日期唯一约束,代表库存与 profile 不适用销量副本淘汰。IAM 权限源为 `iam/src/main/resources/db/selfoperated-analytics-permissions.sql`,自营业务下经营总览、销量分析、库存分析、数据采集的菜单资源与独立读写权限同步国内统一基线,仅平台管理员默认授权。执行和部署状态只维护于工作区测试环境主契约;真实采集模式默认 OFF。
客户/商品资料基线为 `lastleg-service/src/main/resources/db/selfop-master-data.sql`,仅新增 `ll_selfop_owner`、`ll_selfop_product` 两表,并同步在 Lastleg 和海外统一空库基线。按来源账号、货主编码、SKU 和完整资料版本关联,不创建平台客户、收费对象或独立映射表;未知实测尺寸保持 NULL。对 TEST 已有库只审阅并授权这两张新表的 CREATE,不能重放统一初始化文件,也不重置采集数据。
历史库存还原基线为 `lastleg-service/src/main/resources/db/selfop-inventory-history.sql`,新增流水事实、历史日版本和日库存三表;同步 Lastleg 与海外空库基线。仅执行这三表 CREATE,不重放原始库存或销量表。匹配版本复用 `sync_task/run/stage` 的 `INVENTORY_FLOW_HISTORY`、`INVENTORY_HISTORY_BUILD` 与 `INVENTORY_FLOW/HISTORY_INPUT`,原库存快照不改写。完成三表并部署 Integration、Lastleg、Admin 后,才启用 `baiyue.self-operated-analytics.inventory-history-enabled=true`;默认关闭,历史目标30日优先再60日。保留当前账号出口、1200ms间隔和所有被历史版本引用的证据;现有销量副本淘汰不得删除这些引用。
预约工作事项新增结构由 `lastleg-service/src/main/resources/db/appointment-work.sql` 提供五张表:完整范围协调锁、工作关系、不可变历史、承诺影响版本与逐票批次实物分配,已同步 Lastleg 和海外空库初始化入口;对已有 TEST 仅审阅并授权这五表 CREATE 及协调锁初始行。直送目的仓实际卸货独立表由 `firstleg/src/main/resources/db/phase3-direct-delivery-schema.sql` 提供并同步国内空库入口,不产生海外库存。两项独立写权限见 `iam/src/main/resources/db/appointment-work-permissions.sql`,先校验精确权限身份再写入;默认只授权平台管理员。旧预约表的有损重建只允许单独审阅 `reset-test-fba-appointments.sql`;若历史、核实或工作/分配表已存在,前置检查会在 DROP 前拒绝,不能重放或擅自扩大重置范围。以上只维护脚本,不代表已执行或已部署。
换标直接出库的实物体积快照在 `ll_outbound_order.volume_cbm`、`ll_outbound_pallet_item.volume_cbm`、`ll_delivery_order.total_volume_cbm` 三列均允许 NULL,表示来源尚未确认;已有实盘尺寸按箱计算,不能用默认 0 代替未知,也不按 SKU 件数重复累计。两份初始化基线同步此定义,已有 TEST 只能在核对结构和授权后精确调整这三列,不重放空库文件或回填历史行。
## 唯一入口与区域边界
V13 收货覆盖由 `lastleg-service/src/main/resources/db/appointment-receiving.sql` 提供四表:独立收货预约、当前/历史客户成员、待确认变化和不可变覆盖版本;同步 Lastleg 与海外空库基线。有效外部约号唯一性归收货预约的目的仓与约号,批次头表不再独立占用约号。部署前必须核对四表及旧头表唯一索引;本批只准备基线,不提供测试存量回填或自动重置。旧 `reset-test-fba-appointments.sql` 已拒绝存在这些新表的环境,不能用于重放 V13 初始化。实际 SQL 与部署须逐项授权。
两个统一 SQL 文件仍只用于空库初始化,名称中的“增量”不表示可向已有业务库重放。已有生产库的受控结构补齐单独放在 `migrations/`,只允许明确审阅过的增量变更;不提供存量数据回填、清理或兼容入口。
| 区域 | 完整入口 | 服务 schema | 表数 |
|---|---|---|---:|
| 国内 | `头程数据库统一增量-MySQL8.sql` | `baiyue_auth`、`baiyue_iam`、`baiyue_order`、`baiyue_warehouse`、`baiyue_firstleg`、`baiyue_file`、`baiyue_audit`、`baiyue_finance` | 226 |
| 海外 | `海外区域统一增量-MySQL8.sql` | `baiyue_lastleg`、`baiyue_lastlag_warehouse` | 157 |
| 国内 | `头程数据库统一增量-MySQL8.sql` | `baiyue_auth`、`baiyue_iam`、`baiyue_order`、`baiyue_warehouse`、`baiyue_firstleg`、`baiyue_file`、`baiyue_audit`、`baiyue_finance` | 227 |
| 海外 | `海外区域统一增量-MySQL8.sql` | `baiyue_lastleg`、`baiyue_lastlag_warehouse` | 228 |
- 所有服务位于同一测试环境;两份文件只分组组织服务 schema,不代表两个部署区域。`baiyue_lastlag_warehouse` 保留当前正式的 `lastlag` 拼写。
- 两份文件必须在同一测试数据库实例中完成初始化;业务服务仍只访问本服务 schema,经内部接口访问 IAM/Warehouse。已移除事件桥两个 schema 的创建,不对已有数据库执行 DROP。
@@ -22,7 +61,7 @@
- 外接预订的`quote_source_json`保存可选销售报价来源版本快照,实际成交价仍在货物快照及`agreed_amount`中;手填成交价时无报价来源。该字段随Lastleg模块基线与海外统一入口维护,执行状态只见正式部署契约。
- 异常退回的`return_context_json`保存取消时所需的原始业务状态;逐来源`received_packages`累计实际入仓量且不得超过批准退回量。同一派送可以保留多张已取消/已结束的历史退回单,活动退回仍由派送行锁内校验;普通`idx_ll_exception_delivery_return`替代跨全部历史的唯一索引。数量和状态不能通过回填旧单据伪造。
- 派送`ll_delivery_order.signed_packages`保存签收资料确认时冻结的实际签收箱数;NULL表示未确认,不当作全量签收,数量须在0到本次实发箱数之间。后续退回保留原签收历史,不用当前退回量倒改实签。
- `ll_return_stock_receipt`与真实退回库存入账同事务保存,按客户/入账流水唯一,保留原订单和出库位置以及实际入仓位置。重派候选、草稿锁及拣货显式引用该凭据;拣货`receipt_id`与`return_receipt_id`恰有一个非空。退回不增加原订单箱数,不回退历史出库流水;可重新发运量由实际退回及已消耗凭据核平。
- `ll_return_stock_receipt`与真实退回库存入账同事务保存,按客户/入账流水唯一,保留原订单和出库位置以及实际入仓位置。重派候选、草稿锁及拣货显式引用该凭据;`receipt_id`、`return_receipt_id`、`return_carton_id`、`dispatch_item_source_id` 四类拣货归属凭据恰有一个非空。退回不增加原订单箱数,不回退历史出库流水;可重新发运量由实际退回及已消耗凭据核平。
- 国内 Warehouse 管理包括海外仓在内的公共仓库主档;海外 Warehouse 只保存资源与主档 ID 引用。
- Gateway、Print、Integration 不新增数据库。Compose 继续使用 `SPRING_SQL_INIT_MODE=never`,服务启动不执行这些文件。
@@ -35,7 +74,7 @@
5. DDL 隐式提交,不可整体回滚。失败后停止并保留错误;经另行授权准备空库后从头执行,不针对半初始化库追加迁移或从失败行续跑。
6. Firstleg 测量项与拆分项互为外键:建空表期间暂设会话 `foreign_key_checks=0`,随后立即恢复 `1`,再插入种子。失败时关闭连接。两边外键完整保留在 CREATE TABLE 内。
成功时只在最末输出一行 `initialization_status=PASS`,并带 `region=CN/OVERSEAS`、`initialized_tables=226/157`。必须同时确认客户端退出码 0;忽略错误后出现的 PASS 不算成功。
成功时只在最末输出一行 `initialization_status=PASS`,并带 `region=CN/OVERSEAS`、`initialized_tables=227/228`。必须同时确认客户端退出码 0;忽略错误后出现的 PASS 不算成功。
## 平台管理员密码
@@ -51,7 +90,7 @@
| 所属库 | 保留内容 | 不包含 |
|---|---|---|
| Auth / IAM | 平台主体、唯一平台管理员、8 个系统角色及企业管理员模板、417 个权限、598 条角色权限、7 个数据范围、客户编号起点;无人工完成订单权限 | 测试客户、固定客户账号、额外扩权 |
| Auth / IAM | 平台主体、唯一平台管理员、8 个系统角色及企业管理员模板、454 个权限、618 条角色权限、7 个数据范围、客户编号起点;无人工完成订单权限 | 测试客户、固定客户账号、额外扩权 |
| Warehouse | 既有公共仓目录 318 条及地址;义乌、东莞、洛杉矶、纽约 4 个作业仓收货能力 | 示例供应商、快递、往来单位、托盘、库位、预占、库存 |
| Firstleg | 112 个费用项目、15 个渠道目录、7 个始发地别名、4 个公共仓映射 | 客户报价、订单、入库、实测或履约记录 |
| File / Finance | 导出互斥键 `GLOBAL_CREATE`、默认平台财务主体 | 文件任务、资金、账单或交易流水 |
@@ -123,3 +162,11 @@ node --test scripts/admin-test-env-modules/initialization-baseline-contract.test
本次整理使用隔离 MySQL 8.4,国内与海外分别在不存在对方区域 schema 的空库执行两轮,逐表比对整理前最终字段、默认值、索引、约束、注释及业务触发器。SHOW CREATE 的冗余字符集显示与运行态自增计数不视为结构差异;移除示例种子和强制改密是明确行为变更。这不代表已部署或完成真实 HTTP 验收。
码头车队邮件配置见 [Firstleg 车队邮件](../../firstleg/docs/terminal-drayage-mail.md)。
`migrations/overseas/baiyue_lastleg/V24__cargo_discard_photos.sql` 仅新增废弃照片关联表,按客户、申请和托盘关联文件及提交时间。与 Lastleg、File 和三端照片功能共同发布;不回填历史废弃单,不修改库存。脚本存在不表示目标环境已执行。
自营库存周转后端导出权限见 `selfop-turnover-export-permission.sql`,仅新增 `platform:self-operated-analytics:export` 并授予平台管理员;同步 IAM 自营权限源及国内统一基线。配套部署 Lastleg、File、Admin,File 注册 `SELFOP_INVENTORY_TURNOVER`(Nacos同名配置同步);无业务建表及采集配置变更。执行前须逐项授权。
货物废弃通用库存与散箱字段迁移:`migrations/overseas/baiyue_lastleg/V25__cargo_discard_generic_inventory.sql`。新增库存仓位关联及箱唛快照,须先迁移再部署 Lastleg;不回填历史废弃单。
2026-10-16 拉取合并配套结构清单及执行边界见 [数据库变更汇总](20261016-数据库变更汇总.md),已有尾程库使用 `migrations/overseas/baiyue_lastleg/V28__merge_transfer_measurement_and_compact_numbers.sql`;空库初始化海外表数同步为 209。该增量可重复执行,尚未执行到任何实际数据库。
@@ -0,0 +1,28 @@
-- 采购节点动作独立授权;不新建岗位,不以通用编辑权限代替购买与取消。
INSERT INTO iam_permission(id,tenant_id,app_code,permission_type,parent_id,permission_code,permission_name,route_path,http_method,sort_no,status,built_in,deleted)
VALUES
(5117103,0,'PLATFORM','BUTTON',5107100,'platform:overseas-business:purchase:buy','采购购买及货款核定',NULL,'POST',803,'ACTIVE',1,0),
(5117104,0,'PLATFORM','BUTTON',5107100,'platform:overseas-business:purchase:cancel','购买前取消采购订单',NULL,'POST',804,'ACTIVE',1,0),
(5117105,0,'PLATFORM','BUTTON',5107100,'platform:overseas-business:purchase:receive-overseas','采购海外收货',NULL,'POST',805,'ACTIVE',1,0),
(5117106,0,'PLATFORM','BUTTON',5107100,'platform:overseas-business:purchase:receive-domestic','采购国内收货',NULL,'POST',806,'ACTIVE',1,0),
(5117107,0,'PLATFORM','BUTTON',5107100,'platform:overseas-business:purchase:pack','采购装箱与确认',NULL,'POST',807,'ACTIVE',1,0),
(5117108,0,'PLATFORM','BUTTON',5107100,'platform:overseas-business:purchase:manage','采购差异处置与事实更正',NULL,'POST',808,'ACTIVE',1,0),
(5117109,0,'PLATFORM','BUTTON',5107100,'platform:overseas-business:purchase:label','采购面单维护',NULL,'POST',809,'ACTIVE',1,0),
(5117110,0,'PLATFORM','BUTTON',5107100,'platform:overseas-business:purchase:charge','采购国内核费',NULL,'POST',810,'ACTIVE',1,0),
(5117111,0,'PLATFORM','BUTTON',5107100,'platform:overseas-business:purchase:finance-adjust','采购财务调整',NULL,'POST',811,'ACTIVE',1,0),
(5117112,0,'PLATFORM','BUTTON',5107100,'platform:overseas-business:purchase:estimate','采购预估运费核对',NULL,'POST',812,'ACTIVE',1,0),
(5117113,0,'PLATFORM','BUTTON',5107100,'platform:overseas-business:purchase:apply-label','采购逐箱贴单',NULL,'POST',813,'ACTIVE',1,0),
(5117114,0,'PLATFORM','BUTTON',5107100,'platform:overseas-business:purchase:ship-overseas','采购海外整批交寄',NULL,'POST',814,'ACTIVE',1,0),
(5117115,0,'PLATFORM','BUTTON',5107100,'platform:overseas-business:purchase:ship-customer','采购国内寄客户',NULL,'POST',815,'ACTIVE',1,0)
ON DUPLICATE KEY UPDATE permission_name=VALUES(permission_name),status='ACTIVE',deleted=0;
INSERT IGNORE INTO iam_role_permission(tenant_id,role_id,permission_id,created_at)
SELECT 0,r.id,p.id,NOW(3) FROM iam_role r JOIN iam_permission p
ON p.tenant_id=0 AND p.app_code='PLATFORM' AND p.permission_code IN
('platform:overseas-business:purchase:buy','platform:overseas-business:purchase:cancel',
'platform:overseas-business:purchase:receive-overseas','platform:overseas-business:purchase:receive-domestic',
'platform:overseas-business:purchase:pack','platform:overseas-business:purchase:manage',
'platform:overseas-business:purchase:label','platform:overseas-business:purchase:charge','platform:overseas-business:purchase:finance-adjust',
'platform:overseas-business:purchase:estimate','platform:overseas-business:purchase:apply-label',
'platform:overseas-business:purchase:ship-overseas','platform:overseas-business:purchase:ship-customer')
WHERE r.tenant_id=0 AND r.app_code='PLATFORM' AND UPPER(r.role_code) IN('PLATFORM_ADMIN','PLATFORM_CUSTOM_ADMIN')
AND r.status='ACTIVE' AND r.deleted=0;
@@ -0,0 +1,21 @@
-- 仅 baiyue_iam,新增客户废弃确认按钮权限并授权默认客户管理员。
-- 自定义客户角色由管理员按需分配;不自动扩大其权限。
-- 可重复执行;授权和持久化安全版本在同一事务提交。
START TRANSACTION;
INSERT INTO iam_permission(id,tenant_id,app_code,permission_type,parent_id,permission_code,permission_name,route_path,http_method,sort_no,status,built_in,deleted)
VALUES (5306183,0,'MERCHANT','BUTTON',5306180,'merchant:overseas-warehouse:discard:confirm','确认废弃完成',NULL,'POST',30,'ACTIVE',1,0)
ON DUPLICATE KEY UPDATE permission_name=VALUES(permission_name),status='ACTIVE',deleted=0;
INSERT IGNORE INTO iam_role_permission(tenant_id,role_id,permission_id,created_at)
SELECT 0,r.id,p.id,NOW(3) FROM iam_role r JOIN iam_permission p
ON p.tenant_id=0 AND p.app_code='MERCHANT' AND p.permission_code='merchant:overseas-warehouse:discard:confirm'
WHERE r.tenant_id=0 AND r.app_code='MERCHANT' AND r.role_code='MERCHANT_OWNER' AND r.status='ACTIVE' AND r.deleted=0;
INSERT INTO iam_security_subject_version(auth_user_id,permission_version)
SELECT DISTINCT u.auth_user_id,1 FROM iam_user u
JOIN iam_membership m ON m.user_id=u.id
JOIN iam_membership_role mr ON mr.membership_id=m.id AND mr.tenant_id=m.tenant_id
JOIN iam_role r ON r.id=mr.role_id
WHERE u.auth_user_id IS NOT NULL AND u.status='ACTIVE' AND u.deleted=0
AND m.status='ACTIVE' AND m.deleted=0 AND r.tenant_id=0 AND r.app_code='MERCHANT'
AND r.role_code='MERCHANT_OWNER' AND r.status='ACTIVE' AND r.deleted=0
ON DUPLICATE KEY UPDATE permission_version=permission_version+1;
COMMIT;
@@ -0,0 +1,5 @@
-- 采购实扣费用来源关联;仅补充结构,不回填历史费用,不修改资金或业务记录。
-- 执行前核对指定测试环境、baiyue_lastleg schema 与该列尚不存在。
ALTER TABLE ll_finance_fee_source
ADD COLUMN wallet_settlement JSON NULL COMMENT '已实扣应收的Finance资金命令、冻结和消费流水引用'
AFTER payment_voucher_file_ids;
@@ -0,0 +1,48 @@
-- 采购费用确认版本及资金尝试。仅变更结构,不回填、重扣或清理测试存量。
ALTER TABLE ll_overseas_procurement_fee
ADD COLUMN purpose VARCHAR(32) NULL COMMENT '费用业务用途;由履约节点确定',
ADD COLUMN fee_version INT NULL COMMENT '同用途费用确认版本',
ADD COLUMN active TINYINT(1) NOT NULL DEFAULT 1 COMMENT '是否当前有效版本',
ADD COLUMN determination VARCHAR(24) NULL COMMENT 'POSITIVE正额、ZERO零元、NOT_APPLICABLE不适用',
ADD COLUMN original_currency CHAR(3) NULL COMMENT '核定原币CNY或USD',
ADD COLUMN original_amount DECIMAL(20,2) NULL COMMENT '核定原币金额',
ADD COLUMN exchange_rate DECIMAL(20,6) NULL COMMENT '已确认汇率快照',
ADD COLUMN exchange_rate_month CHAR(7) NULL COMMENT '已确认汇率所属月份',
ADD COLUMN business_date DATE NULL COMMENT '实际费用业务日期',
ADD COLUMN wallet_business_id BIGINT NULL COMMENT '资金冻结对应采购费用记录',
ADD COLUMN wallet_business_no VARCHAR(128) NULL COMMENT '资金冻结业务号;实际国际运费引用原预估',
ADD COLUMN wallet_hold_id VARCHAR(64) NULL COMMENT 'Finance冻结引用',
ADD COLUMN wallet_ledger_id VARCHAR(64) NULL COMMENT 'Finance实际处理流水引用',
ADD COLUMN settled_command_event_id VARCHAR(64) NULL COMMENT '成功实扣或退款的资金命令事件',
ADD COLUMN source_fee_id BIGINT NULL COMMENT '已实扣费用来源ID',
ADD COLUMN parent_fee_id BIGINT NULL COMMENT '原费用或预估引用',
ADD COLUMN request_hash CHAR(64) NULL COMMENT '确认请求摘要',
MODIFY COLUMN voucher_file_id BIGINT NULL COMMENT '凭证文件ID;零元可空',
MODIFY COLUMN voucher_file_name VARCHAR(255) NULL COMMENT '凭证文件名;零元可空',
DROP CHECK chk_ll_procurement_fee_amount,
ADD CONSTRAINT chk_ll_procurement_fee_amount CHECK(amount>=0),
ADD UNIQUE KEY uk_ll_procurement_fee_version(order_id,purpose,fee_item_code,fee_version);
CREATE TABLE ll_procurement_wallet_attempt (
id BIGINT NOT NULL COMMENT '请求尝试ID',
order_id BIGINT NOT NULL COMMENT '采购订单ID',
customer_id VARCHAR(128) NOT NULL COMMENT '客户隔离键',
fee_id BIGINT NOT NULL COMMENT '不可变费用版本ID',
attempt_no BIGINT NOT NULL COMMENT '费用版本内请求序号',
operation VARCHAR(32) NOT NULL COMMENT '资金操作:FREEZE冻结、SETTLE结算、SETTLE_ACTUAL实际结算、RELEASE释放、REFUND退款',
business_no VARCHAR(128) NOT NULL COMMENT 'Finance资金业务号',
amount DECIMAL(20,2) NULL COMMENT '请求金额;全额结算或释放可空',
command_event_id VARCHAR(64) NOT NULL COMMENT '资金指令事件唯一引用',
status VARCHAR(16) NOT NULL COMMENT '资金请求结果:PENDING未决、SUCCEEDED成功、FAILED明确失败',
result_hash CHAR(64) NULL COMMENT '原业务回执摘要',
wallet_hold_id VARCHAR(64) NULL COMMENT 'Finance冻结引用',
wallet_ledger_id VARCHAR(64) NULL COMMENT 'Finance处理流水引用',
error_code VARCHAR(64) NULL COMMENT '业务失败码',
error_message VARCHAR(500) NULL COMMENT '内部失败诊断,不直接对客展示',
created_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '请求时间',
completed_at DATETIME(3) NULL COMMENT '最终结果时间',
PRIMARY KEY(id), UNIQUE KEY uk_procurement_attempt_event(command_event_id),
UNIQUE KEY uk_procurement_attempt_number(fee_id,attempt_no),
KEY idx_procurement_attempt_order(customer_id,order_id,status),
CONSTRAINT chk_procurement_attempt_status CHECK(status IN('PENDING','SUCCEEDED','FAILED'))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='采购费用资金命令尝试与不可变结果';
@@ -0,0 +1,57 @@
-- 采购节点事实与操作幂等;不补写历史订单的购买、授权或收货事实。
CREATE TABLE ll_procurement_flow (
order_id BIGINT NOT NULL COMMENT '采购订单ID,一单一个履约批次',
customer_id VARCHAR(128) NOT NULL COMMENT '客户隔离键',
purchased_at DATETIME(3) NULL COMMENT '真实购买时间',
purchased_product_name VARCHAR(255) NULL COMMENT '实际购买商品',
purchased_specification VARCHAR(500) NULL COMMENT '实际购买规格',
purchased_quantity BIGINT NULL COMMENT '实际购买件数',
purchase_amount DECIMAL(20,2) NULL COMMENT '供应商实付原币金额',
purchase_currency CHAR(3) NULL COMMENT '供应商实付原币CNY或USD',
purchase_voucher_id BIGINT NULL COMMENT '购买凭证引用',
purchase_issue VARCHAR(500) NULL COMMENT '购买未核定或异常说明',
purchase_confirmed_at DATETIME(3) NULL COMMENT '货款核定时间,不代表扣费成功',
actual_warehouse_id BIGINT NULL COMMENT '首次实际收货冻结的仓库ID',
actual_warehouse_code VARCHAR(128) NULL COMMENT '实际收货仓编码快照',
actual_warehouse_name VARCHAR(255) NULL COMMENT '实际收货仓名称快照',
overseas_received_at DATETIME(3) NULL COMMENT '海外整批收货完成时间',
packing_version INT NULL COMMENT '当前确认装箱清单版本',
overseas_shipped_at DATETIME(3) NULL COMMENT '国际段整批实际交寄时间',
domestic_received_at DATETIME(3) NULL COMMENT '国内整批收货完成时间',
charges_confirmed_at DATETIME(3) NULL COMMENT '国内整单费用核定时间',
customer_shipped_at DATETIME(3) NULL COMMENT '国内寄客户实际交寄时间',
domestic_receiver_name VARCHAR(128) NULL COMMENT '国际段国内收件人',
domestic_receiver_phone VARCHAR(64) NULL COMMENT '国际段国内收件电话',
domestic_receiver_address VARCHAR(1000) NULL COMMENT '国际段国内接收地址',
cancelled_at DATETIME(3) NULL COMMENT '购买前取消时间',
closed_at DATETIME(3) NULL COMMENT '异常关闭时间',
control_reason VARCHAR(1000) NULL COMMENT '取消或关闭原因',
created_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '创建时间',
updated_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3) COMMENT '更新时间',
PRIMARY KEY(order_id), KEY idx_procurement_flow_customer(customer_id,order_id),
CONSTRAINT chk_procurement_purchase_quantity CHECK(purchased_quantity IS NULL OR purchased_quantity>0),
CONSTRAINT chk_procurement_purchase_amount CHECK(purchase_amount IS NULL OR purchase_amount>=0)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='采购单一批次履约事实';
CREATE TABLE ll_procurement_command (
id BIGINT NOT NULL COMMENT '操作记录ID', order_id BIGINT NOT NULL COMMENT '采购订单ID',
customer_id VARCHAR(128) NOT NULL COMMENT '客户隔离键', action VARCHAR(48) NOT NULL COMMENT '采购节点动作',
idempotency_key VARCHAR(128) NOT NULL COMMENT '操作幂等键', request_hash CHAR(64) NOT NULL COMMENT '请求摘要',
operator_id VARCHAR(128) NOT NULL COMMENT '执行人', reason VARCHAR(1000) NOT NULL COMMENT '操作依据',
detail_json JSON NOT NULL COMMENT '内部操作及更正依据快照,不直接对客展示',
created_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '执行时间',
PRIMARY KEY(id), UNIQUE KEY uk_procurement_command(order_id,action,idempotency_key),
KEY idx_procurement_command_customer(customer_id,order_id,created_at)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='采购节点幂等与不可变审计';
CREATE TABLE ll_procurement_budget_authorization (
id BIGINT NOT NULL COMMENT '预算授权ID', order_id BIGINT NOT NULL COMMENT '采购订单ID',
customer_id VARCHAR(128) NOT NULL COMMENT '客户隔离键',
previous_amount DECIMAL(20,2) NULL COMMENT '原货款预算总上限;未授权保持空', previous_currency CHAR(3) NOT NULL COMMENT '原预算币种',
authorized_amount DECIMAL(20,2) NOT NULL COMMENT '客户授权的新货款总上限', currency CHAR(3) NOT NULL COMMENT '客户授权币种',
voucher_file_id BIGINT NOT NULL COMMENT '客户确认书面或聊天凭证', reason VARCHAR(1000) NOT NULL COMMENT '授权依据',
reviewed_by VARCHAR(128) NOT NULL COMMENT '核验人员', reviewed_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '核验时间',
PRIMARY KEY(id), KEY idx_procurement_budget_order(customer_id,order_id,id),
CONSTRAINT chk_procurement_budget_amount CHECK(authorized_amount>=0 AND previous_amount>=0),
CONSTRAINT chk_procurement_budget_currency CHECK(currency IN('CNY','USD') AND previous_currency IN('CNY','USD'))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='采购货款预算授权核验历史';
@@ -0,0 +1,65 @@
-- 采购实收、差异、装箱和两段整批发运事实。不产生WMS库存流水,不回填历史采购数量。
CREATE TABLE ll_procurement_receipt (
id BIGINT NOT NULL COMMENT '实收明细ID', order_id BIGINT NOT NULL COMMENT '采购订单ID', customer_id VARCHAR(128) NOT NULL COMMENT '客户隔离键',
receipt_no VARCHAR(64) NOT NULL COMMENT '采购收货业务编号', leg VARCHAR(16) NOT NULL COMMENT 'OVERSEAS海外或DOMESTIC国内',
source_carton_id BIGINT NULL COMMENT '国内实收关联原国际交寄箱,海外为空', warehouse_id BIGINT NULL COMMENT '海外实际收货仓',
good_quantity BIGINT NOT NULL COMMENT '可发合格件数', damaged_quantity BIGINT NOT NULL COMMENT '破损待处置件数', extra_quantity BIGINT NOT NULL COMMENT '多到件数,不增加可发数量',
received_at DATETIME(3) NOT NULL COMMENT '实际收货时间', active TINYINT(1) NOT NULL DEFAULT 1 COMMENT '当前有效实收事实',
supersedes_id BIGINT NULL COMMENT '受控更正所替代的原实收记录', created_by VARCHAR(128) NOT NULL COMMENT '登记人员',
created_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '登记时间',
PRIMARY KEY(id), UNIQUE KEY uk_procurement_receipt_no(receipt_no), KEY idx_procurement_receipt_source(order_id,leg,source_carton_id,active),
CONSTRAINT chk_procurement_receipt_quantity CHECK(good_quantity>=0 AND damaged_quantity>=0 AND extra_quantity>=0 AND good_quantity+damaged_quantity+extra_quantity>0),
CONSTRAINT chk_procurement_receipt_leg CHECK((leg='OVERSEAS' AND source_carton_id IS NULL) OR (leg='DOMESTIC' AND source_carton_id IS NOT NULL))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='采购分次实收与受控更正事实';
CREATE TABLE ll_procurement_disposition (
id BIGINT NOT NULL COMMENT '差异处理ID', order_id BIGINT NOT NULL COMMENT '采购订单ID', customer_id VARCHAR(128) NOT NULL COMMENT '客户隔离键',
leg VARCHAR(16) NOT NULL COMMENT 'OVERSEAS海外或DOMESTIC国内', source_carton_id BIGINT NULL COMMENT '国内原交寄箱来源',
receipt_id BIGINT NULL COMMENT '破损或多货对应实收记录,短少为空', kind VARCHAR(24) NOT NULL COMMENT 'SHORTAGE短少、DAMAGED破损、EXTRA多货',
quantity BIGINT NOT NULL COMMENT '已批准处置件数', decision VARCHAR(32) NOT NULL COMMENT 'ACCEPT_SHORTAGE确认短少、DISPOSE_DAMAGED拒收或处置、RETURN_EXTRA退回多货',
active TINYINT(1) NOT NULL DEFAULT 1 COMMENT '当前有效处置;撤销只改变有效性并保留原事实',
voucher_file_id BIGINT NOT NULL COMMENT '本单客户确认或实际处置凭证', reason VARCHAR(1000) NOT NULL COMMENT '处置依据',
created_by VARCHAR(128) NOT NULL COMMENT '采购管理人员', created_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '确认时间',
PRIMARY KEY(id), KEY idx_procurement_disposition_source(order_id,leg,source_carton_id,receipt_id,kind),
CONSTRAINT chk_procurement_disposition_quantity CHECK(quantity>0)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='采购单内差异处置,不自动退款';
CREATE TABLE ll_procurement_manifest (
id BIGINT NOT NULL COMMENT '装箱清单ID', order_id BIGINT NOT NULL COMMENT '采购订单ID', customer_id VARCHAR(128) NOT NULL COMMENT '客户隔离键',
version INT NOT NULL COMMENT '订单内装箱版本', status VARCHAR(16) NOT NULL COMMENT 'DRAFT草稿、CONFIRMED已确认、SUPERSEDED已替代',
confirmed_at DATETIME(3) NULL COMMENT '确认时间', created_by VARCHAR(128) NOT NULL COMMENT '制单人',
created_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '版本保存时间',
PRIMARY KEY(id), UNIQUE KEY uk_procurement_manifest_version(order_id,version),
CONSTRAINT chk_procurement_manifest_status CHECK(status IN('DRAFT','CONFIRMED','SUPERSEDED'))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='采购装箱清单不可变版本';
CREATE TABLE ll_procurement_carton (
id BIGINT NOT NULL COMMENT '版本内箱记录ID', order_id BIGINT NOT NULL COMMENT '采购订单ID', manifest_id BIGINT NOT NULL COMMENT '装箱清单版本',
carton_no VARCHAR(64) NOT NULL COMMENT '采购订单内业务箱号', length_cm DECIMAL(12,2) NOT NULL COMMENT '外箱长厘米',
width_cm DECIMAL(12,2) NOT NULL COMMENT '外箱宽厘米', height_cm DECIMAL(12,2) NOT NULL COMMENT '外箱高厘米',
gross_weight_kg DECIMAL(12,3) NOT NULL COMMENT '封箱毛重千克', quantity BIGINT NOT NULL COMMENT '本箱合格商品总件数',
PRIMARY KEY(id), UNIQUE KEY uk_procurement_carton_version(manifest_id,carton_no), KEY idx_procurement_carton_order(order_id,manifest_id),
CONSTRAINT chk_procurement_carton_measurement CHECK(length_cm>0 AND width_cm>0 AND height_cm>0 AND gross_weight_kg>0 AND quantity>0)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='采购版本化逐箱实测与件数';
CREATE TABLE ll_procurement_carton_source (
carton_id BIGINT NOT NULL COMMENT '版本内箱ID', receipt_id BIGINT NOT NULL COMMENT '海外实收明细来源', quantity BIGINT NOT NULL COMMENT '从该实收装入本箱的件数',
PRIMARY KEY(carton_id,receipt_id), KEY idx_procurement_carton_receipt(receipt_id), CONSTRAINT chk_procurement_carton_source_quantity CHECK(quantity>0)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='采购箱内货物的实收来源与数量';
CREATE TABLE ll_procurement_shipment (
id BIGINT NOT NULL COMMENT '采购交寄ID', order_id BIGINT NOT NULL COMMENT '采购订单ID', customer_id VARCHAR(128) NOT NULL COMMENT '客户隔离键',
shipment_no VARCHAR(64) NOT NULL COMMENT '交寄业务编号', leg VARCHAR(16) NOT NULL COMMENT 'OVERSEAS国际交寄或DOMESTIC寄客户',
manifest_id BIGINT NOT NULL COMMENT '原海外装箱清单版本', shipped_at DATETIME(3) NOT NULL COMMENT '整批真实交承运方时间',
address_snapshot JSON NOT NULL COMMENT '本段交寄时的收寄姓名电话地址快照', created_by VARCHAR(128) NOT NULL COMMENT '交寄确认人',
created_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '确认时间',
PRIMARY KEY(id), UNIQUE KEY uk_procurement_shipment_leg(order_id,leg), UNIQUE KEY uk_procurement_shipment_no(shipment_no),
CONSTRAINT chk_procurement_shipment_leg CHECK(leg IN('OVERSEAS','DOMESTIC'))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='采购两段各一次整批真实交寄';
CREATE TABLE ll_procurement_shipment_item (
shipment_id BIGINT NOT NULL COMMENT '采购交寄ID', carton_id BIGINT NOT NULL COMMENT '原海外装箱版本内箱ID', quantity BIGINT NOT NULL COMMENT '本次实际交寄件数',
carrier VARCHAR(128) NOT NULL COMMENT '承运商快照', tracking_no VARCHAR(128) NOT NULL COMMENT '运单号快照',
label_snapshot JSON NOT NULL COMMENT '当次箱规、面单及货物来源快照',
PRIMARY KEY(shipment_id,carton_id), CONSTRAINT chk_procurement_shipment_item_quantity CHECK(quantity>0)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='采购整批交寄逐箱事实';
@@ -0,0 +1,40 @@
-- 采购面单、逐箱贴单、预估核对与国内一对一换包装;不重建历史发运事实。
CREATE TABLE ll_procurement_label_set (
id BIGINT NOT NULL COMMENT '面单批版本ID', order_id BIGINT NOT NULL COMMENT '采购订单ID', customer_id VARCHAR(128) NOT NULL COMMENT '客户隔离键',
leg VARCHAR(16) NOT NULL COMMENT 'OVERSEAS国际段或DOMESTIC寄客户段', version INT NOT NULL COMMENT '订单段内面单版本',
manifest_id BIGINT NOT NULL COMMENT '原海外确认装箱版本', cargo_hash CHAR(64) NOT NULL COMMENT '箱规及有效货物来源摘要',
sender_snapshot JSON NOT NULL COMMENT '寄件人姓名电话地址快照', receiver_snapshot JSON NOT NULL COMMENT '收件人姓名电话地址快照',
created_by VARCHAR(128) NOT NULL COMMENT '制单操作人', created_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '上传确认时间',
PRIMARY KEY(id), UNIQUE KEY uk_procurement_label_version(order_id,leg,version),
CONSTRAINT chk_procurement_label_leg CHECK(leg IN('OVERSEAS','DOMESTIC'))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='采购两段面单不可变版本和地址快照';
CREATE TABLE ll_procurement_label_item (
label_set_id BIGINT NOT NULL COMMENT '面单批版本ID', carton_id BIGINT NOT NULL COMMENT '原海外清单箱ID',
file_id BIGINT NOT NULL COMMENT '本采购订单面单文件', page_no INT NOT NULL COMMENT '该箱对应文件页码,从1开始',
carrier VARCHAR(128) NOT NULL COMMENT '承运商', tracking_no VARCHAR(128) NOT NULL COMMENT '箱主或子运单号',
applied_at DATETIME(3) NULL COMMENT '真实贴单时间', applied_by VARCHAR(128) NULL COMMENT '贴单确认人',
PRIMARY KEY(label_set_id,carton_id), CONSTRAINT chk_procurement_label_page CHECK(page_no>0)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='采购逐箱文件页关联及贴单事实';
CREATE TABLE ll_procurement_estimate_review (
id BIGINT NOT NULL COMMENT '预估核对ID', order_id BIGINT NOT NULL COMMENT '采购订单ID', label_set_id BIGINT NOT NULL COMMENT '已核对国际面单版本',
fee_id BIGINT NOT NULL COMMENT '唯一有效预估费用版本', reviewed_by VARCHAR(128) NOT NULL COMMENT '核价人员',
reviewed_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '核对时间',
PRIMARY KEY(id), UNIQUE KEY uk_procurement_estimate_review(label_set_id,fee_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='面单清单与预估冻结的显式核对关联';
CREATE TABLE ll_procurement_repack (
id BIGINT NOT NULL COMMENT '换包装版本ID', order_id BIGINT NOT NULL COMMENT '采购订单ID', carton_id BIGINT NOT NULL COMMENT '原国际交寄箱ID,保持一对一来源',
length_cm DECIMAL(12,2) NOT NULL COMMENT '新外箱长厘米', width_cm DECIMAL(12,2) NOT NULL COMMENT '新外箱宽厘米',
height_cm DECIMAL(12,2) NOT NULL COMMENT '新外箱高厘米', gross_weight_kg DECIMAL(12,3) NOT NULL COMMENT '新封箱毛重千克',
voucher_file_id BIGINT NOT NULL COMMENT '本单换包装证据', reason VARCHAR(1000) NOT NULL COMMENT '换包装依据',
created_by VARCHAR(128) NOT NULL COMMENT '国内作业人员', created_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '登记时间',
PRIMARY KEY(id), KEY idx_procurement_repack_carton(order_id,carton_id,id),
CONSTRAINT chk_procurement_repack_measurement CHECK(length_cm>0 AND width_cm>0 AND height_cm>0 AND gross_weight_kg>0)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='采购国内原箱一对一换包装不可变历史';
ALTER TABLE ll_overseas_procurement_file
DROP CHECK chk_ll_procurement_file_category,
MODIFY COLUMN category VARCHAR(16) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'RECEIPT实收、VOUCHER费用、LABEL面单、PURCHASE采购、BUDGET预算、EXCEPTION异常凭证',
ADD CONSTRAINT chk_ll_procurement_file_category CHECK(category IN ('RECEIPT','VOUCHER','LABEL','PURCHASE','BUDGET','EXCEPTION'));
@@ -0,0 +1,20 @@
-- 费用链目标更正快照与关联;资金流水仍唯一归Finance,不回填旧费用。
CREATE TABLE ll_procurement_fee_correction (
id BIGINT NOT NULL COMMENT '费用链更正ID', order_id BIGINT NOT NULL COMMENT '采购订单ID', customer_id VARCHAR(128) NOT NULL COMMENT '客户隔离键',
correction_no VARCHAR(64) NOT NULL COMMENT '财务更正业务号', root_fee_id BIGINT NOT NULL COMMENT '原实际费用链根',
idempotency_key VARCHAR(128) NOT NULL COMMENT '本单更正请求幂等键', request_hash CHAR(64) NOT NULL COMMENT '更正目标及凭证请求摘要',
target_original_amount DECIMAL(20,2) NOT NULL COMMENT '本次正确原币总额', original_currency CHAR(3) NOT NULL COMMENT '沿用原费用币种',
exchange_rate DECIMAL(20,6) NOT NULL COMMENT '沿用原费用汇率快照', exchange_rate_month CHAR(7) NOT NULL COMMENT '原汇率月份,不取本次操作月份',
target_amount DECIMAL(20,2) NOT NULL COMMENT '正确总额折算CNY', previous_net_amount DECIMAL(20,2) NOT NULL COMMENT '确认前整链净实扣CNY',
difference_amount DECIMAL(20,2) NOT NULL COMMENT 'CNY正差额追加、负差额退款、零差额仅留核对记录',
voucher_file_id BIGINT NOT NULL COMMENT '本订单财务更正凭证', reason VARCHAR(500) NOT NULL COMMENT '更正依据',
created_by VARCHAR(128) NOT NULL COMMENT '授权财务操作人', created_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '确认时间',
PRIMARY KEY(id), UNIQUE KEY uk_procurement_correction_no(correction_no), UNIQUE KEY uk_procurement_correction_request(order_id,idempotency_key),
KEY idx_procurement_correction_root(order_id,root_fee_id,id),
CONSTRAINT chk_procurement_correction_amount CHECK(target_original_amount>=0 AND target_amount>=0 AND previous_net_amount>=0 AND exchange_rate>0)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='采购费用链更正目标与原汇率快照';
CREATE TABLE ll_procurement_fee_correction_item (
correction_id BIGINT NOT NULL COMMENT '本次费用链更正ID', fee_id BIGINT NOT NULL COMMENT '本次产生的独立正差额或退款费用ID',
PRIMARY KEY(correction_id,fee_id), UNIQUE KEY uk_procurement_correction_fee(fee_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='采购费用目标更正与逐笔资金事实关联';
@@ -0,0 +1,31 @@
-- 单采购订单内的更正说明、阻断异常与关闭证据。不生成WMS库存或退货运输任务。
CREATE TABLE ll_procurement_control_note (
id BIGINT NOT NULL COMMENT '采购更正说明ID', order_id BIGINT NOT NULL COMMENT '采购订单ID', customer_id VARCHAR(128) NOT NULL COMMENT '客户隔离键',
note_no VARCHAR(64) NOT NULL COMMENT '更正说明业务号', target_type VARCHAR(24) NOT NULL COMMENT '购买、仓库、实收或交寄事实类型',
target_id BIGINT NULL COMMENT '本单事实对象引用,购买为空', blocking TINYINT(1) NOT NULL COMMENT '是否阻断后续计划履约',
voucher_file_id BIGINT NOT NULL COMMENT '本单内部事实更正凭证', reason VARCHAR(1000) NOT NULL COMMENT '内部更正说明',
client_summary VARCHAR(500) NULL COMMENT '人工确认的对客摘要,不复制内部原始内容',
original_value_json JSON NULL COMMENT '服务端记录的原事实快照', corrected_value_json JSON NULL COMMENT '服务端记录的更正事实快照',
created_by VARCHAR(128) NOT NULL COMMENT '采购管理操作人', created_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '登记时间',
resolved_by VARCHAR(128) NULL COMMENT '处理确认人', resolved_at DATETIME(3) NULL COMMENT '阻断解除时间',
resolution_reason VARCHAR(1000) NULL COMMENT '内部处理结果', resolution_voucher_id BIGINT NULL COMMENT '本单处理凭证',
PRIMARY KEY(id), UNIQUE KEY uk_procurement_note_no(note_no), KEY idx_procurement_note_block(order_id,blocking,resolved_at)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='采购不可覆盖事实的更正说明及阻断异常';
CREATE TABLE ll_procurement_closure (
id BIGINT NOT NULL COMMENT '采购异常关闭ID', order_id BIGINT NOT NULL COMMENT '采购订单ID', customer_id VARCHAR(128) NOT NULL COMMENT '客户隔离键',
closure_no VARCHAR(64) NOT NULL COMMENT '异常关闭业务号', customer_voucher_file_id BIGINT NOT NULL COMMENT '客户同意停止履约凭证',
financial_conclusion VARCHAR(1000) NOT NULL COMMENT '已知费用及后续无需收费的处理结论,不改变资金事实',
reason VARCHAR(1000) NOT NULL COMMENT '内部关闭原因', client_summary VARCHAR(500) NOT NULL COMMENT '人工确认的对客关闭摘要',
created_by VARCHAR(128) NOT NULL COMMENT '采购管理确认人', created_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '关闭确认时间',
PRIMARY KEY(id), UNIQUE KEY uk_procurement_closure_order(order_id), UNIQUE KEY uk_procurement_closure_no(closure_no)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='采购实物资金收口后的异常关闭事实';
CREATE TABLE ll_procurement_closure_item (
id BIGINT NOT NULL COMMENT '关闭货物处置ID', closure_id BIGINT NOT NULL COMMENT '采购关闭ID',
source_kind VARCHAR(32) NOT NULL COMMENT '购买未达、在途未达、合格、破损或多货来源', source_id BIGINT NULL COMMENT '原实收或国际交寄箱,购买未达为空',
quantity BIGINT NOT NULL COMMENT '本来源最终明确去向件数', decision VARCHAR(40) NOT NULL COMMENT '供应商保管、退还、报失、客户授权保管或处置',
destination VARCHAR(500) NOT NULL COMMENT '实际去向及接收方说明', voucher_file_id BIGINT NOT NULL COMMENT '本单实物处置证明',
PRIMARY KEY(id), KEY idx_procurement_closure_source(closure_id,source_kind,source_id),
CONSTRAINT chk_procurement_closure_quantity CHECK(quantity>0)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='异常关闭逐来源剩余货物最终去向,不产生新发运';
@@ -0,0 +1,4 @@
-- 采购费用核定入口。仅结构变更,不回填旧财务事实,不重试或补扣测试存量。
ALTER TABLE ll_overseas_procurement_fee
ADD COLUMN confirmation_origin VARCHAR(16) NOT NULL DEFAULT 'BUSINESS' COMMENT '核定入口:BUSINESS业务节点、FINANCIAL财务操作',
ADD CONSTRAINT chk_procurement_confirmation_origin CHECK(confirmation_origin IN('BUSINESS','FINANCIAL'));
@@ -0,0 +1,21 @@
CREATE TABLE IF NOT EXISTS ll_selfop_warehouse_daily_sales (
sales_run_id BIGINT NOT NULL COMMENT '完整销量计算版本标识',
source_account VARCHAR(64) NOT NULL COMMENT '受控来源账号别名,不保存密钥',
warehouse_code VARCHAR(64) NOT NULL COMMENT '来源仓库原始编码',
business_date DATE NOT NULL COMMENT '已核准业务日',
observed_quantity DECIMAL(38,6) NULL COMMENT '该日PCS非负有效出库量之和,无有效行时为空',
invalid_row_count BIGINT NOT NULL COMMENT '该日数量为空或负数或单位非PCS的日事实行数',
source_row_count BIGINT NOT NULL COMMENT '该日参与仓库汇总的SKU日事实总行数',
created_at DATETIME(3) NOT NULL COMMENT 'UTC创建时间',
updated_at DATETIME(3) NOT NULL COMMENT 'UTC更新时间',
PRIMARY KEY (sales_run_id,source_account,warehouse_code,business_date),
CONSTRAINT chk_selfop_warehouse_daily_sales CHECK (source_row_count > 0 AND invalid_row_count >= 0 AND invalid_row_count <= source_row_count AND (observed_quantity IS NULL OR observed_quantity >= 0))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='完整销量版本按仓按日汇总,随SKU日事实批次原子构建';
SET @selfop_warehouse_daily_ready_ddl = IF(
EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='ll_selfop_sync_run' AND column_name='warehouse_daily_ready'),
'SELECT 1',
'ALTER TABLE ll_selfop_sync_run ADD COLUMN warehouse_daily_ready TINYINT NOT NULL DEFAULT 0 COMMENT ''仓库日汇总已完整构建并校验,含完整空版本''');
PREPARE selfop_warehouse_daily_ready_stmt FROM @selfop_warehouse_daily_ready_ddl;
EXECUTE selfop_warehouse_daily_ready_stmt;
DEALLOCATE PREPARE selfop_warehouse_daily_ready_stmt;
@@ -0,0 +1,44 @@
-- Region: OVERSEAS
-- Schema: baiyue_lastleg
-- Purpose: 统一退货进销存 UNION 文本列排序规则,去除查询转换需求
-- Preconditions: 八张退货表已存在;核对字段长度、可空性、默认值及唯一索引无目标规则冲突
-- Postconditions: 指定文本字段及表默认规则统一为 utf8mb4_unicode_ci;不修改数量、状态或业务标识
-- 不重放空库基线;本文件可重复执行。DDL 非事务,失败停止并核对后续执行范围。
ALTER TABLE ll_return_order
DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
MODIFY COLUMN customer_id VARCHAR(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '客户ID和隔离键',
MODIFY COLUMN overseas_warehouse_id VARCHAR(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '操作海外仓ID';
ALTER TABLE ll_return_order_item
DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
MODIFY COLUMN sku_code VARCHAR(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'SKU编码',
MODIFY COLUMN product_name_zh VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '中文品名';
ALTER TABLE ll_return_receipt
DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
MODIFY COLUMN receipt_no VARCHAR(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '签收单号';
ALTER TABLE ll_return_receipt_item
DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
MODIFY COLUMN sku_code VARCHAR(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'SKU编码';
ALTER TABLE ll_return_inventory_carton
DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
MODIFY COLUMN customer_id VARCHAR(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '客户ID和隔离键',
MODIFY COLUMN overseas_warehouse_id VARCHAR(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '海外仓ID',
MODIFY COLUMN carton_mark VARCHAR(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '退货箱号和箱唛编码';
ALTER TABLE ll_return_inventory_carton_item
DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
MODIFY COLUMN sku_code VARCHAR(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'SKU编码',
MODIFY COLUMN product_name_zh VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '中文品名';
ALTER TABLE ll_return_inventory_outbound_movement
DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
MODIFY COLUMN customer_id VARCHAR(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '库存所属客户ID和隔离键',
MODIFY COLUMN overseas_warehouse_id VARCHAR(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '实际出库海外仓ID',
MODIFY COLUMN sku_code VARCHAR(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '本次出库SKU编码快照',
MODIFY COLUMN product_name_zh VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '中文品名快照',
MODIFY COLUMN outbound_no VARCHAR(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '本次退货出库业务单号';
ALTER TABLE ll_return_sku_conversion
DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
MODIFY COLUMN customer_id VARCHAR(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '客户隔离键',
MODIFY COLUMN overseas_warehouse_id VARCHAR(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '操作海外仓ID',
MODIFY COLUMN old_sku_code VARCHAR(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '换标前SKU',
MODIFY COLUMN new_sku_code VARCHAR(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '换标后SKU',
MODIFY COLUMN product_name_zh VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '中文品名快照',
MODIFY COLUMN relabel_no VARCHAR(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '换标单号';
@@ -0,0 +1,16 @@
CREATE TABLE IF NOT EXISTS ll_cargo_discard_photo (
id BIGINT NOT NULL,
customer_id VARCHAR(64) NOT NULL,
application_id BIGINT NOT NULL,
pallet_no VARCHAR(128) NOT NULL,
file_id BIGINT NOT NULL,
file_name VARCHAR(255) NOT NULL,
content_type VARCHAR(128) NOT NULL,
size_bytes BIGINT NOT NULL,
operator_id VARCHAR(64) NOT NULL,
created_at DATETIME(6) NOT NULL,
submitted_at DATETIME(6) NULL,
PRIMARY KEY (id),
UNIQUE KEY uk_cargo_discard_photo_file (file_id),
KEY idx_cargo_discard_photo_application (customer_id, application_id, pallet_no)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
@@ -0,0 +1,24 @@
-- 货物废弃支持所有入库来源及散箱全量作业;不回填或修改历史单据。
SET @ddl = IF(NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='ll_cargo_discard_item' AND column_name='inventory_position_id'),
'ALTER TABLE ll_cargo_discard_item ADD COLUMN inventory_position_id BIGINT NULL COMMENT ''废弃来源库存仓位ID''', 'SELECT 1');
PREPARE stmt FROM @ddl; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @ddl = IF(NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='ll_cargo_discard_item' AND column_name='carton_marks_json'),
'ALTER TABLE ll_cargo_discard_item ADD COLUMN carton_marks_json TEXT NULL COMMENT ''本次废弃所选真实箱唛快照JSON数组''', 'SELECT 1');
PREPARE stmt FROM @ddl; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @ddl = IF(NOT EXISTS (SELECT 1 FROM information_schema.statistics WHERE table_schema=DATABASE() AND table_name='ll_cargo_discard_item' AND index_name='uk_ll_discard_position_sku'),
'ALTER TABLE ll_cargo_discard_item ADD UNIQUE KEY uk_ll_discard_position_sku(application_id,inventory_position_id,sku_code)', 'SELECT 1');
PREPARE stmt FROM @ddl; EXECUTE stmt; DEALLOCATE PREPARE stmt;
ALTER TABLE ll_cargo_discard_item MODIFY COLUMN source_type VARCHAR(32) NOT NULL DEFAULT 'DROPSHIP' COMMENT '库存来源:一件代发DROPSHIP、退货箱RETURN_CARTON、通用库存INVENTORY';
SET @ddl = IF(NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='ll_cargo_discard_item' AND column_name='carton_scan_required'),
'ALTER TABLE ll_cargo_discard_item ADD COLUMN carton_scan_required TINYINT(1) NOT NULL DEFAULT 0 COMMENT ''是否需要逐箱核对本次所选箱子''', 'SELECT 1');
PREPARE stmt FROM @ddl; EXECUTE stmt; DEALLOCATE PREPARE stmt;
ALTER TABLE ll_cargo_discard_item MODIFY COLUMN carton_marks_json TEXT NULL COMMENT '本次废弃所选真实箱唛快照JSON数组';
ALTER TABLE ll_inbound_plan_carton MODIFY COLUMN status VARCHAR(32) NOT NULL COMMENT '箱唛状态:未绑定UNASSIGNED、已绑托ON_PALLET、整票收货BULK_RECEIVED、可用AVAILABLE、待废弃DISCARD_PENDING、已废弃DISCARDED';
SET @ddl = IF(NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='ll_cargo_discard_carton' AND column_name='source_type'),
'ALTER TABLE ll_cargo_discard_carton ADD COLUMN source_type VARCHAR(32) NOT NULL DEFAULT ''DROPSHIP'' COMMENT ''箱子来源:一件代发DROPSHIP、入仓箱INBOUND、转运箱TRANSFER''', 'SELECT 1');
PREPARE stmt FROM @ddl; EXECUTE stmt; DEALLOCATE PREPARE stmt;
@@ -0,0 +1,13 @@
-- 整箱废弃后保留SKU明细,剩余数量允许归零,仍禁止负库存。
-- 原子替换约束,可重复执行;不修改业务记录。
SET @ddl = IF(EXISTS (
SELECT 1 FROM information_schema.table_constraints
WHERE constraint_schema=DATABASE() AND table_name='ll_return_inventory_carton_item'
AND constraint_name='chk_ll_return_inventory_carton_item_quantity'
),
'ALTER TABLE ll_return_inventory_carton_item DROP CHECK chk_ll_return_inventory_carton_item_quantity, ADD CONSTRAINT chk_ll_return_inventory_carton_item_quantity CHECK(quantity>=0)',
'ALTER TABLE ll_return_inventory_carton_item ADD CONSTRAINT chk_ll_return_inventory_carton_item_quantity CHECK(quantity>=0)'
);
PREPARE stmt FROM @ddl;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
@@ -0,0 +1,3 @@
-- 客户确认废弃完结时间,可重复执行;仅结构变更。
SET @ddl = IF(NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='ll_cargo_discard_application' AND column_name='customer_confirmed_at'), 'ALTER TABLE ll_cargo_discard_application ADD COLUMN customer_confirmed_at DATETIME(3) NULL COMMENT ''客户确认废弃完结时间''', 'SELECT 1');
PREPARE stmt FROM @ddl; EXECUTE stmt; DEALLOCATE PREPARE stmt;
@@ -0,0 +1,70 @@
-- 2026-10-16 拉取合并及本地恢复配套增量,MySQL 8。
-- 目标:lastleg-service / baiyue_lastleg;前置:已有业务表及此前迁移。
-- 只调整结构,不回填、删除或重算业务数据;执行失败应停止,修复后可重跑。
SET NAMES utf8mb4;
USE baiyue_lastleg;
CREATE TABLE IF NOT EXISTS ll_compact_number_clock (
number_key VARCHAR(16) NOT NULL COMMENT '业务前缀和客户名称缩写',
last_second BIGINT NOT NULL COMMENT '最后分配的Unix逻辑秒',
PRIMARY KEY (number_key)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='海外业务短单号分配时钟';
-- 仓储转运逐箱测量与清点;仅增加字段,不修改业务数据。
USE baiyue_lastleg;
SET @ddl = (SELECT IF(EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='ll_warehouse_transfer_carton' AND column_name='length_cm'), 'SELECT 1', 'ALTER TABLE ll_warehouse_transfer_carton ADD COLUMN length_cm DECIMAL(12,2) NULL COMMENT ''箱子实测长度厘米'''));
PREPARE transfer_count_stmt FROM @ddl; EXECUTE transfer_count_stmt; DEALLOCATE PREPARE transfer_count_stmt;
SET @ddl = (SELECT IF(EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='ll_warehouse_transfer_carton' AND column_name='width_cm'), 'SELECT 1', 'ALTER TABLE ll_warehouse_transfer_carton ADD COLUMN width_cm DECIMAL(12,2) NULL COMMENT ''箱子实测宽度厘米'''));
PREPARE transfer_count_stmt FROM @ddl; EXECUTE transfer_count_stmt; DEALLOCATE PREPARE transfer_count_stmt;
SET @ddl = (SELECT IF(EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='ll_warehouse_transfer_carton' AND column_name='height_cm'), 'SELECT 1', 'ALTER TABLE ll_warehouse_transfer_carton ADD COLUMN height_cm DECIMAL(12,2) NULL COMMENT ''箱子实测高度厘米'''));
PREPARE transfer_count_stmt FROM @ddl; EXECUTE transfer_count_stmt; DEALLOCATE PREPARE transfer_count_stmt;
SET @ddl = (SELECT IF(EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='ll_warehouse_transfer_carton' AND column_name='gross_weight_kg'), 'SELECT 1', 'ALTER TABLE ll_warehouse_transfer_carton ADD COLUMN gross_weight_kg DECIMAL(12,2) NULL COMMENT ''箱子实测重量千克'''));
PREPARE transfer_count_stmt FROM @ddl; EXECUTE transfer_count_stmt; DEALLOCATE PREPARE transfer_count_stmt;
SET @ddl = (SELECT IF(EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='ll_warehouse_transfer_carton' AND column_name='counted_quantity'), 'SELECT 1', 'ALTER TABLE ll_warehouse_transfer_carton ADD COLUMN counted_quantity BIGINT NULL COMMENT ''箱内SKU实点件数'''));
PREPARE transfer_count_stmt FROM @ddl; EXECUTE transfer_count_stmt; DEALLOCATE PREPARE transfer_count_stmt;
SET @ddl = (SELECT IF(EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='ll_warehouse_transfer_carton' AND column_name='count_idempotency_key'), 'SELECT 1', 'ALTER TABLE ll_warehouse_transfer_carton ADD COLUMN count_idempotency_key VARCHAR(255) NULL COMMENT ''箱内清点幂等键'''));
PREPARE transfer_count_stmt FROM @ddl; EXECUTE transfer_count_stmt; DEALLOCATE PREPARE transfer_count_stmt;
SET @ddl = (SELECT IF(EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='ll_warehouse_transfer_carton' AND column_name='count_request_hash'), 'SELECT 1', 'ALTER TABLE ll_warehouse_transfer_carton ADD COLUMN count_request_hash VARCHAR(64) NULL COMMENT ''箱内清点请求摘要'''));
PREPARE transfer_count_stmt FROM @ddl; EXECUTE transfer_count_stmt; DEALLOCATE PREPARE transfer_count_stmt;
SET @ddl = (SELECT IF(EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='ll_warehouse_transfer_carton' AND column_name='counted_by'), 'SELECT 1', 'ALTER TABLE ll_warehouse_transfer_carton ADD COLUMN counted_by VARCHAR(128) NULL COMMENT ''箱内清点操作人'''));
PREPARE transfer_count_stmt FROM @ddl; EXECUTE transfer_count_stmt; DEALLOCATE PREPARE transfer_count_stmt;
SET @ddl = (SELECT IF(EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='ll_warehouse_transfer_carton' AND column_name='counted_at'), 'SELECT 1', 'ALTER TABLE ll_warehouse_transfer_carton ADD COLUMN counted_at DATETIME(3) NULL COMMENT ''箱内清点完成时间'''));
PREPARE transfer_count_stmt FROM @ddl; EXECUTE transfer_count_stmt; DEALLOCATE PREPARE transfer_count_stmt;
SET @ddl = (SELECT IF(EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='ll_warehouse_transfer_carton' AND column_name='discrepancy_reason'), 'SELECT 1', 'ALTER TABLE ll_warehouse_transfer_carton ADD COLUMN discrepancy_reason VARCHAR(1000) NULL COMMENT ''实收与预报箱数差异原因'''));
PREPARE transfer_count_stmt FROM @ddl; EXECUTE transfer_count_stmt; DEALLOCATE PREPARE transfer_count_stmt;
SET @ddl = (SELECT IF(EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='ll_warehouse_transfer_carton' AND column_name='transfer_pallet_id'), 'SELECT 1', 'ALTER TABLE ll_warehouse_transfer_carton ADD COLUMN transfer_pallet_id BIGINT NULL COMMENT ''签收箱所属转运托盘事实ID'''));
PREPARE transfer_count_stmt FROM @ddl; EXECUTE transfer_count_stmt; DEALLOCATE PREPARE transfer_count_stmt;
-- SKU 申报件数独立于预计箱数;历史未申报件数保持 NULL,实收以 PDA 清点为准。
SET @ddl = (SELECT IF(EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='ll_warehouse_transfer_item' AND column_name='declared_quantity'), 'SELECT 1', 'ALTER TABLE ll_warehouse_transfer_item ADD COLUMN declared_quantity BIGINT NULL COMMENT ''SKU申报件数,非预计或实收箱数'''));
PREPARE transfer_quantity_stmt FROM @ddl; EXECUTE transfer_quantity_stmt; DEALLOCATE PREPARE transfer_quantity_stmt;
-- 仓储转运一箱多SKU清点;仅增加结构,不回填历史业务数据。
USE baiyue_lastleg;
SET @ddl = (SELECT IF(EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='ll_warehouse_transfer_carton' AND column_name='sku_items_json'), 'SELECT 1', 'ALTER TABLE ll_warehouse_transfer_carton ADD COLUMN sku_items_json JSON NULL COMMENT ''实收箱内SKU及逐项件数明细'''));
PREPARE transfer_sku_stmt FROM @ddl; EXECUTE transfer_sku_stmt; DEALLOCATE PREPARE transfer_sku_stmt;
SET @ddl = IF(NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='ll_warehouse_transfer_carton' AND column_name='customer_carton_mark'), 'ALTER TABLE ll_warehouse_transfer_carton ADD COLUMN customer_carton_mark VARCHAR(255) NULL COMMENT ''客户原箱唛,用于换标现场绑定''', 'SELECT 1');
PREPARE merge_schema_stmt FROM @ddl; EXECUTE merge_schema_stmt; DEALLOCATE PREPARE merge_schema_stmt;
SET @ddl = IF(NOT EXISTS (SELECT 1 FROM information_schema.statistics WHERE table_schema=DATABASE() AND table_name='ll_cargo_discard_item' AND index_name='idx_ll_cargo_discard_return_carton'), 'ALTER TABLE ll_cargo_discard_item ADD KEY idx_ll_cargo_discard_return_carton(customer_id,return_carton_id)', 'SELECT 1');
PREPARE merge_schema_stmt FROM @ddl; EXECUTE merge_schema_stmt; DEALLOCATE PREPARE merge_schema_stmt;
SET @ddl = IF(EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='ll_warehouse_transfer_order' AND column_name='estimated_arrival_at' AND is_nullable='NO'), 'ALTER TABLE ll_warehouse_transfer_order MODIFY COLUMN estimated_arrival_at DATETIME(3) NULL COMMENT ''预计入仓时间,库存转运不填写''', 'SELECT 1');
PREPARE merge_schema_stmt FROM @ddl; EXECUTE merge_schema_stmt; DEALLOCATE PREPARE merge_schema_stmt;
SET @ddl = IF(EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='ll_delivery_order' AND column_name='total_volume_cbm' AND is_nullable='NO'), 'ALTER TABLE ll_delivery_order MODIFY COLUMN total_volume_cbm DECIMAL(18,4) NULL COMMENT ''体积(立方米),来源未确认时为空''', 'SELECT 1');
PREPARE merge_schema_stmt FROM @ddl; EXECUTE merge_schema_stmt; DEALLOCATE PREPARE merge_schema_stmt;
SET @ddl = IF(EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='ll_outbound_order' AND column_name='volume_cbm' AND is_nullable='NO'), 'ALTER TABLE ll_outbound_order MODIFY COLUMN volume_cbm DECIMAL(18,4) NULL COMMENT ''体积(立方米),来源未确认时为空''', 'SELECT 1');
PREPARE merge_schema_stmt FROM @ddl; EXECUTE merge_schema_stmt; DEALLOCATE PREPARE merge_schema_stmt;
SET @ddl = IF(EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='ll_outbound_pallet_item' AND column_name='volume_cbm' AND is_nullable='NO'), 'ALTER TABLE ll_outbound_pallet_item MODIFY COLUMN volume_cbm DECIMAL(18,4) NULL COMMENT ''体积(立方米),来源未确认时为空''', 'SELECT 1');
PREPARE merge_schema_stmt FROM @ddl; EXECUTE merge_schema_stmt; DEALLOCATE PREPARE merge_schema_stmt;
-- 执行后核对本次结构;这不是应用功能验收。
SELECT table_name,column_name,column_type,is_nullable,column_comment FROM information_schema.columns
WHERE table_schema=DATABASE() AND table_name IN ('ll_compact_number_clock','ll_warehouse_transfer_carton','ll_warehouse_transfer_item','ll_warehouse_transfer_order','ll_delivery_order','ll_outbound_order','ll_outbound_pallet_item')
ORDER BY table_name,ordinal_position;
@@ -0,0 +1,2 @@
-- 对应数据库:baiyue_lastleg;可重复执行,不修改原箱号、SKU预报件数和实测数据。
ALTER TABLE ll_warehouse_transfer_carton MODIFY COLUMN transfer_item_id BIGINT NULL COMMENT '实际箱内首项SKU明细ID,预报补箱可为空';
+112
View File
@@ -0,0 +1,112 @@
-- TEST ONLY. Rebuild the explicitly authorized appointment header and item tables.
-- The command-history and cargo-verification tables MUST NOT already exist; check both before any DROP.
-- If either exists, stop and inspect the prior outcome. Do not clear history or blindly retry.
-- Requires explicit approval; never run against production or as automatic startup SQL.
-- Caller must verify the TEST connection before executing.
USE baiyue_lastleg;
DROP PROCEDURE IF EXISTS assert_test_appointment_reset_preconditions;
DELIMITER $$
CREATE PROCEDURE assert_test_appointment_reset_preconditions()
BEGIN
IF EXISTS(SELECT 1 FROM information_schema.tables WHERE table_schema=DATABASE()
AND table_name IN ('ll_fba_appointment_command','ll_appointment_cargo_verification',
'll_appointment_work','ll_dispatch_appointment_allocation','ll_fba_receiving_agreement',
'll_fba_receiving_member','ll_fba_receiving_change','ll_fba_receiving_revision','ll_fba_receiving_plan')) THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT='Stop: appointment history or work/allocation schema already exists; inspect before any reset';
END IF;
IF (SELECT COUNT(*) FROM information_schema.tables WHERE table_schema=DATABASE()
AND table_name IN ('ll_inbound_fba_appointment','ll_inbound_fba_appointment_item')) <> 2 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT='Stop: expected both legacy appointment tables; inspect partial or new schema';
END IF;
END$$
DELIMITER ;
CALL assert_test_appointment_reset_preconditions();
DROP PROCEDURE assert_test_appointment_reset_preconditions;
DROP TABLE ll_inbound_fba_appointment_item;
DROP TABLE ll_inbound_fba_appointment;
CREATE TABLE ll_inbound_fba_appointment (
id BIGINT NOT NULL COMMENT '主键ID',
appointment_no VARCHAR(64) NOT NULL COMMENT '系统预约业务单号,不是外部约号',
confirmation_no VARCHAR(128) NULL COMMENT '收货方正式外部确认号',
planned_date DATE NULL COMMENT '计划当地日期,可只有日期而无时段',
planned_at DATETIME(3) NULL COMMENT '计划开始当地时间,待定可空',
planned_end_at DATETIME(3) NULL COMMENT '计划结束当地时间',
appointment_at DATETIME(3) NULL COMMENT '对方确认开始当地时间',
appointment_end_at DATETIME(3) NULL COMMENT '对方确认结束当地时间',
appointment_start_utc DATETIME(3) NULL COMMENT '确认开始UTC时间点',
appointment_end_utc DATETIME(3) NULL COMMENT '确认结束UTC时间点',
timezone VARCHAR(64) NULL COMMENT '目的仓权威IANA时区,未维护不得确认',
origin_warehouse_id VARCHAR(64) NOT NULL COMMENT '实际起运仓',
version INT NOT NULL DEFAULT 0 COMMENT '并发版本',
appointment_status VARCHAR(32) NOT NULL DEFAULT 'PENDING' COMMENT 'PENDING安排/SUCCESS对方确认/FAILED/CANCELLED',
appointment_remark VARCHAR(1000) NULL COMMENT '备注或取消原因',
fba_warehouse_code VARCHAR(128) NOT NULL COMMENT 'FBA目的仓编码',
selected_count INT NOT NULL DEFAULT 0 COMMENT '真实货源票数',
replacement_nos_json LONGTEXT NULL COMMENT '分批或合并后的新预约业务号列表,非空时原批次只读',
replacement_keys_json LONGTEXT NULL COMMENT '替代批次不可变键列表,只用于内部业务关联',
repartition_reason VARCHAR(1000) NULL COMMENT '分批或合并原因,原安排及来源明细保留',
created_by VARCHAR(128) NOT NULL COMMENT '登录操作人',
created_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '创建UTC时间',
updated_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '更新UTC时间',
PRIMARY KEY (id),
UNIQUE KEY uk_ll_fba_appointment_no (appointment_no),
KEY idx_ll_fba_appointment_list (appointment_at,appointment_status,fba_warehouse_code),
KEY idx_ll_fba_appointment_planned (planned_at,appointment_status)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='FBA预约安排与正式确认唯一主记录';
CREATE TABLE ll_inbound_fba_appointment_item (
id BIGINT NOT NULL COMMENT '记录主键',
appointment_id BIGINT NOT NULL COMMENT '预约主记录标识',
source_key VARCHAR(160) NOT NULL COMMENT '稳定ORDER或BOOKING货源键',
source_version VARCHAR(160) NULL COMMENT '保存时核实的来源版本',
customer_id VARCHAR(128) NOT NULL COMMENT '本票所属客户',
order_id BIGINT NULL COMMENT '尚未形成尾程订单时为空',
inbound_code VARCHAR(128) NULL COMMENT '真实入仓码,不伪造',
fba_warehouse_code VARCHAR(128) NOT NULL COMMENT '目的FBA仓编码',
package_count INT NULL COMMENT '本批分配箱数,未知保持空;同一原来源总量守恒',
cargo_verification_version INT NULL COMMENT '采用的预约货物核实版本,未核实时为空',
shipment_references_json LONGTEXT NULL COMMENT '本次采用的货件或追踪号核实快照',
active TINYINT(1) NOT NULL DEFAULT 1 COMMENT '当前批次数量分配有效;取消、未约成和完成均保留,仅替代时释放',
created_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '创建UTC时间',
PRIMARY KEY (id),
UNIQUE KEY uk_ll_fba_item_source (appointment_id,source_key),
KEY idx_ll_fba_active_source (customer_id,source_key,active),
KEY idx_ll_fba_active_order (customer_id,order_id,active),
KEY idx_ll_fba_item_source_lookup (source_key,customer_id),
KEY idx_ll_fba_item_customer_order (customer_id,order_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='入仓前后共用的预约真实货源';
CREATE TABLE ll_appointment_cargo_verification (
id BIGINT NOT NULL COMMENT '核实记录主键',
customer_id VARCHAR(128) NOT NULL COMMENT '原货源所属客户',
source_key VARCHAR(160) NOT NULL COMMENT '稳定ORDER或BOOKING原来源键',
destination_key VARCHAR(160) NOT NULL COMMENT '核实时的原目的地',
source_version VARCHAR(160) NULL COMMENT '核实时的原来源版本',
source_packages INT NULL COMMENT '核实时的原来源箱数,未知为空',
version INT NOT NULL COMMENT '同一来源的核实版本,从一递增',
package_count INT NULL COMMENT '独立核实箱数,不回写原订单',
shipment_references_json LONGTEXT NOT NULL COMMENT '本票货件号或追踪号列表,不回写原订单',
remark VARCHAR(1000) NULL COMMENT '核实说明',
operator_id VARCHAR(128) NOT NULL COMMENT '登录操作人',
operator_name VARCHAR(200) NULL COMMENT '操作人名称快照',
command_key VARCHAR(64) NOT NULL COMMENT '来源内幂等命令键',
request_hash CHAR(64) NOT NULL COMMENT '来源、操作人及请求摘要',
created_at DATETIME(3) NOT NULL COMMENT '核实UTC时间',
PRIMARY KEY (id),
UNIQUE KEY uk_ll_cargo_verification_version (customer_id,source_key,version),
UNIQUE KEY uk_ll_cargo_verification_command (customer_id,source_key,command_key),
CONSTRAINT chk_ll_cargo_verification_quantity CHECK (package_count IS NULL OR package_count > 0),
CONSTRAINT chk_ll_cargo_verification_version CHECK (version > 0)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='预约货物核实资料及不可覆盖的版本历史';
CREATE TABLE ll_fba_appointment_command (
command_key VARCHAR(128) NOT NULL COMMENT '持久化幂等键',
request_hash CHAR(64) NOT NULL COMMENT '操作、操作者和请求摘要',
operation VARCHAR(96) NOT NULL COMMENT '操作类型及目标业务号',
operator_id VARCHAR(128) NOT NULL COMMENT '登录操作人',
appointment_no VARCHAR(64) NULL COMMENT '系统预约业务单号',
response_json LONGTEXT NULL COMMENT '原命令返回快照,与业务写入同事务',
created_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '创建UTC时间',
PRIMARY KEY(command_key),
KEY idx_ll_fba_command_appointment(appointment_no,created_at)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='预约命令与变更历史';
@@ -0,0 +1,11 @@
-- 自营库存周转后端导出权限;不建表,不修改销量、库存或采集任务。
USE baiyue_iam;
SET NAMES utf8mb4;
START TRANSACTION;
INSERT INTO iam_permission (id,tenant_id,app_code,permission_type,parent_id,permission_code,permission_name,route_path,http_method,sort_no,status,built_in,created_at,updated_at,deleted) VALUES
(5118002,0,'PLATFORM','API',5118120,'platform:self-operated-analytics:export','导出平台自营库存周转','/api/platform/v1/files/export-tasks','POST',20,'ACTIVE',1,CURRENT_TIMESTAMP(3),CURRENT_TIMESTAMP(3),0)
ON DUPLICATE KEY UPDATE permission_name=VALUES(permission_name),route_path=VALUES(route_path),http_method=VALUES(http_method),status='ACTIVE',deleted=0,updated_at=CURRENT_TIMESTAMP(3);
INSERT INTO iam_role_permission (role_id,permission_id,tenant_id,created_at)
SELECT 4000001,5118002,0,CURRENT_TIMESTAMP(3)
WHERE NOT EXISTS (SELECT 1 FROM iam_role_permission WHERE role_id=4000001 AND permission_id=5118002 AND tenant_id=0);
COMMIT;
+405 -313
View File
@@ -2,7 +2,7 @@
-- MySQL 8.0+;只允许目标测试环境的服务 schema 为空,已有表立即报错;禁止 --force/遇错继续。
-- 字段、索引、约束及注释直接定义在 CREATE TABLE 内;不回填、不清理、不改造存量。
-- 国内 IAM 管理两区域权限;海外不访问国内库。执行方法及系统种子清单见同目录 README.md。
-- DDL 隐式提交;失败后停止,不从中间续跑,也不把部分初始化当成成功。
-- DDL 隐式提交;失败后停止,不从中间续跑,也不把部分初始化当成成功。utf8mb4_0900_ai_ci
SET NAMES utf8mb4 COLLATE utf8mb4_0900_ai_ci;
SET SESSION sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';
@@ -466,6 +466,8 @@ CREATE TABLE sys_audit_outbox (
-- 服务 schema:baiyue_order
CREATE DATABASE IF NOT EXISTS baiyue_order DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci;
USE baiyue_order;
CREATE TABLE ord_customer_address (
@@ -1130,7 +1132,7 @@ CREATE TABLE wh_warehouse (
warehouse_name varchar(120) NOT NULL COMMENT '仓库名称',
warehouse_type varchar(32) NOT NULL DEFAULT 'DOMESTIC' COMMENT '公共仓库类型:DOMESTIC国内仓、FBA亚马逊仓、OVERSEAS普通海外仓、OVERSEAS_PARTNER海外合作仓',
country_code char(2) NOT NULL COMMENT '所在国家二字码',
timezone varchar(64) NOT NULL COMMENT '仓库所在地UTC偏移量',
timezone varchar(64) NOT NULL COMMENT '仓库所在地IANA时区,待核实为空',
contact_name varchar(64) DEFAULT NULL COMMENT '仓库联系人',
contact_phone varchar(32) DEFAULT NULL COMMENT '联系电话',
contact_email varchar(128) DEFAULT NULL COMMENT '联系邮箱',
@@ -1420,7 +1422,6 @@ CREATE TABLE fl_consumed_event (
CREATE TABLE fl_container_booking (
id bigint unsigned NOT NULL COMMENT '货柜预订ID(雪花ID)',
booking_no varchar(40) NOT NULL COMMENT '平台唯一货柜预订单号',
container_no varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '真实集装箱号权威快照;同一订舱内唯一,不同提单允许复用;确认前允许修订',
cabinet_no varchar(64) NOT NULL COMMENT '平台唯一内部柜号',
source_type varchar(24) NOT NULL DEFAULT 'SIMULATION' COMMENT '记录来源:SIMULATION内部模拟柜、OCEAN_BOOKING订舱真实柜',
@@ -1475,7 +1476,6 @@ CREATE TABLE fl_container_booking (
updated_at datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3) COMMENT '货柜资料最后更新时间',
version int unsigned NOT NULL DEFAULT '0' COMMENT '乐观锁版本号',
PRIMARY KEY (id),
UNIQUE KEY uk_container_booking_no (booking_no),
UNIQUE KEY uk_container_booking_cabinet (cabinet_no),
UNIQUE KEY uk_container_booking_ocean_container (ocean_booking_id,container_no),
KEY idx_container_booking_container_no (container_no,updated_at,id),
@@ -4102,6 +4102,27 @@ CREATE TABLE fl_split_operation (
CONSTRAINT fk_split_operation_inbound FOREIGN KEY (inbound_id) REFERENCES fl_inbound_order (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='分柜操作幂等与审计索引';
-- Current schema for actual destination unloading; never an overseas warehouse receipt.
CREATE TABLE fl_direct_delivery_unloading (
container_booking_id BIGINT UNSIGNED NOT NULL,
inbound_id BIGINT UNSIGNED NOT NULL COMMENT 'Immutable physically loaded inbound source',
actual_at DATETIME(3) NOT NULL COMMENT 'Actual destination local time',
timezone VARCHAR(64) NOT NULL COMMENT 'Explicit destination IANA timezone',
received_by VARCHAR(128) NOT NULL COMMENT 'Actual recipient',
evidence_no VARCHAR(128) NOT NULL COMMENT 'Actual delivery receipt reference',
remark VARCHAR(1000) NULL,
version INT NOT NULL DEFAULT 1,
idempotency_key VARCHAR(128) NOT NULL,
request_hash CHAR(64) NOT NULL,
created_by BIGINT UNSIGNED NOT NULL,
created_by_name VARCHAR(64) NULL,
created_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
PRIMARY KEY (container_booking_id,inbound_id),
UNIQUE KEY uk_direct_unloading_command (container_booking_id,idempotency_key),
CONSTRAINT fk_direct_unloading_container FOREIGN KEY (container_booking_id) REFERENCES fl_container_booking(id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='直送目的仓真实卸货凭据';
CREATE TABLE fl_terminal_drayage (
id bigint unsigned NOT NULL COMMENT '目的港码头拖车聚合ID',
container_booking_id bigint unsigned NOT NULL COMMENT '唯一归属物理货柜ID',
@@ -5335,7 +5356,7 @@ CREATE TRIGGER trg_container_booking_before_update BEFORE UPDATE ON fl_container
SELECT MAX(plan_status) INTO current_plan_status
FROM baiyue_firstleg.fl_loading_plan WHERE container_booking_id = OLD.id;
IF current_plan_status IN ('LOADING', 'COMPLETED') AND (
NOT (OLD.id <=> NEW.id) OR NOT (OLD.booking_no <=> NEW.booking_no)
NOT (OLD.id <=> NEW.id)
OR NOT (OLD.cabinet_no <=> NEW.cabinet_no)
OR NOT (OLD.channel_group_code <=> NEW.channel_group_code)
OR NOT (OLD.channel_code <=> NEW.channel_code) OR NOT (OLD.channel_name <=> NEW.channel_name)
@@ -6335,10 +6356,9 @@ INSERT INTO iam_permission (id, tenant_id, app_code, permission_type, parent_id,
INSERT INTO iam_permission (id, tenant_id, app_code, permission_type, parent_id, permission_code, permission_name, route_path, http_method, sort_no, status, built_in, created_at, updated_at, deleted) VALUES (5107011,0,'PLATFORM','BUTTON',5107010,'platform:overseas-warehouse:inbound-order:create','创建海外入仓计划',NULL,'POST',711,'ACTIVE',1,CURRENT_TIMESTAMP(3),CURRENT_TIMESTAMP(3),0);
INSERT INTO iam_permission (id, tenant_id, app_code, permission_type, parent_id, permission_code, permission_name, route_path, http_method, sort_no, status, built_in, created_at, updated_at, deleted) VALUES (5107012,0,'PLATFORM','BUTTON',5107010,'platform:overseas-warehouse:inbound-order:edit','编辑海外入仓计划',NULL,'POST',712,'ACTIVE',1,CURRENT_TIMESTAMP(3),CURRENT_TIMESTAMP(3),0);
INSERT INTO iam_permission (id, tenant_id, app_code, permission_type, parent_id, permission_code, permission_name, route_path, http_method, sort_no, status, built_in, created_at, updated_at, deleted) VALUES (5107013,0,'PLATFORM','BUTTON',5107010,'platform:overseas-warehouse:inbound-order:fba-appointment','FBA预约',NULL,'POST',713,'ACTIVE',1,CURRENT_TIMESTAMP(3),CURRENT_TIMESTAMP(3),0);
INSERT INTO iam_permission (id, tenant_id, app_code, permission_type, parent_id, permission_code, permission_name, route_path, http_method, sort_no, status, built_in, created_at, updated_at, deleted) VALUES (5107014,0,'PLATFORM','BUTTON',5107010,'platform:overseas-warehouse:inbound-order:smart-dispatch','智能排车',NULL,'POST',714,'ACTIVE',1,CURRENT_TIMESTAMP(3),CURRENT_TIMESTAMP(3),0);
INSERT INTO iam_permission (id, tenant_id, app_code, permission_type, parent_id, permission_code, permission_name, route_path, http_method, sort_no, status, built_in, created_at, updated_at, deleted) VALUES (5107015,0,'PLATFORM','BUTTON',5107010,'lastleg:pda:operate','海外仓PDA入仓作业',NULL,'POST',715,'ACTIVE',1,CURRENT_TIMESTAMP(3),CURRENT_TIMESTAMP(3),0);
INSERT INTO iam_permission (id, tenant_id, app_code, permission_type, parent_id, permission_code, permission_name, route_path, http_method, sort_no, status, built_in, created_at, updated_at, deleted) VALUES (5107016,0,'PLATFORM','BUTTON',5107064,'platform:overseas-warehouse:dispatch:edit','编辑海外排车',NULL,'PUT',716,'ACTIVE',1,CURRENT_TIMESTAMP(3),CURRENT_TIMESTAMP(3),0);
INSERT INTO iam_permission (id, tenant_id, app_code, permission_type, parent_id, permission_code, permission_name, route_path, http_method, sort_no, status, built_in, created_at, updated_at, deleted) VALUES (5107017,0,'PLATFORM','BUTTON',5107064,'platform:overseas-warehouse:dispatch:cancel','取消海外排车',NULL,'DELETE',717,'ACTIVE',1,CURRENT_TIMESTAMP(3),CURRENT_TIMESTAMP(3),0);
INSERT INTO iam_permission (id, tenant_id, app_code, permission_type, parent_id, permission_code, permission_name, route_path, http_method, sort_no, status, built_in, created_at, updated_at, deleted) VALUES (5107017,0,'PLATFORM','BUTTON',5107064,'platform:overseas-warehouse:dispatch:cancel','取消海外排车',NULL,'POST',717,'ACTIVE',1,CURRENT_TIMESTAMP(3),CURRENT_TIMESTAMP(3),0);
INSERT INTO iam_permission (id, tenant_id, app_code, permission_type, parent_id, permission_code, permission_name, route_path, http_method, sort_no, status, built_in, created_at, updated_at, deleted) VALUES (5107018,0,'PLATFORM','BUTTON',5107064,'platform:overseas-warehouse:dispatch:transfer-delivery','排车转派送',NULL,'POST',718,'ACTIVE',1,CURRENT_TIMESTAMP(3),CURRENT_TIMESTAMP(3),0);
INSERT INTO iam_permission (id, tenant_id, app_code, permission_type, parent_id, permission_code, permission_name, route_path, http_method, sort_no, status, built_in, created_at, updated_at, deleted) VALUES (5107020,0,'PLATFORM','MENU',0,'platform:overseas-warehouse:relabel-order:list','海外换标单','/overseas-warehouse/relabel-orders','GET',720,'ACTIVE',1,CURRENT_TIMESTAMP(3),CURRENT_TIMESTAMP(3),0);
INSERT INTO iam_permission (id, tenant_id, app_code, permission_type, parent_id, permission_code, permission_name, route_path, http_method, sort_no, status, built_in, created_at, updated_at, deleted) VALUES (5107021,0,'PLATFORM','BUTTON',5107020,'platform:overseas-warehouse:relabel-order:create','创建海外换标单',NULL,'POST',721,'ACTIVE',1,CURRENT_TIMESTAMP(3),CURRENT_TIMESTAMP(3),0);
@@ -6360,6 +6380,9 @@ INSERT INTO iam_permission (id, tenant_id, app_code, permission_type, parent_id,
INSERT INTO iam_permission (id, tenant_id, app_code, permission_type, parent_id, permission_code, permission_name, route_path, http_method, sort_no, status, built_in, created_at, updated_at, deleted) VALUES (5107062,0,'PLATFORM','BUTTON',5107060,'platform:overseas-warehouse:location:edit','编辑海外库位',NULL,'PUT',762,'ACTIVE',1,CURRENT_TIMESTAMP(3),CURRENT_TIMESTAMP(3),0);
INSERT INTO iam_permission (id, tenant_id, app_code, permission_type, parent_id, permission_code, permission_name, route_path, http_method, sort_no, status, built_in, created_at, updated_at, deleted) VALUES (5107063,0,'PLATFORM','BUTTON',5107060,'platform:overseas-warehouse:location:delete','删除海外库位',NULL,'DELETE',763,'ACTIVE',1,CURRENT_TIMESTAMP(3),CURRENT_TIMESTAMP(3),0);
INSERT INTO iam_permission (id, tenant_id, app_code, permission_type, parent_id, permission_code, permission_name, route_path, http_method, sort_no, status, built_in, created_at, updated_at, deleted) VALUES (5107064,0,'PLATFORM','MENU',0,'platform:overseas-warehouse:dispatch:list','海外排车单','/overseas-warehouse/dispatches','GET',764,'ACTIVE',1,CURRENT_TIMESTAMP(3),CURRENT_TIMESTAMP(3),0);
INSERT INTO iam_permission (id, tenant_id, app_code, permission_type, parent_id, permission_code, permission_name, route_path, http_method, sort_no, status, built_in, created_at, updated_at, deleted) VALUES (5107065,0,'PLATFORM','BUTTON',5107064,'platform:overseas-warehouse:dispatch:create','新增排车单',NULL,'POST',765,'ACTIVE',1,CURRENT_TIMESTAMP(3),CURRENT_TIMESTAMP(3),0);
INSERT INTO iam_permission (id, tenant_id, app_code, permission_type, parent_id, permission_code, permission_name, route_path, http_method, sort_no, status, built_in, created_at, updated_at, deleted) VALUES (5107066,0,'PLATFORM','BUTTON',5107064,'platform:overseas-warehouse:dispatch:loading-complete','确认装车完成',NULL,'POST',766,'ACTIVE',1,CURRENT_TIMESTAMP(3),CURRENT_TIMESTAMP(3),0);
INSERT INTO iam_permission (id, tenant_id, app_code, permission_type, parent_id, permission_code, permission_name, route_path, http_method, sort_no, status, built_in, created_at, updated_at, deleted) VALUES (5107067,0,'PLATFORM','BUTTON',5107064,'platform:overseas-warehouse:dispatch:depart','确认实际发车',NULL,'POST',767,'ACTIVE',1,CURRENT_TIMESTAMP(3),CURRENT_TIMESTAMP(3),0);
INSERT INTO iam_permission (id, tenant_id, app_code, permission_type, parent_id, permission_code, permission_name, route_path, http_method, sort_no, status, built_in, created_at, updated_at, deleted) VALUES (5107070,0,'PLATFORM','MENU',0,'platform:overseas-warehouse:exception-order:list','海外异常订单','/overseas-warehouse/exception-orders','GET',770,'ACTIVE',1,CURRENT_TIMESTAMP(3),CURRENT_TIMESTAMP(3),0);
INSERT INTO iam_permission (id, tenant_id, app_code, permission_type, parent_id, permission_code, permission_name, route_path, http_method, sort_no, status, built_in, created_at, updated_at, deleted) VALUES (5107071,0,'PLATFORM','BUTTON',5107070,'platform:overseas-warehouse:exception-order:create','新增海外异常订单',NULL,'POST',771,'ACTIVE',1,CURRENT_TIMESTAMP(3),CURRENT_TIMESTAMP(3),0);
INSERT INTO iam_permission (id, tenant_id, app_code, permission_type, parent_id, permission_code, permission_name, route_path, http_method, sort_no, status, built_in, created_at, updated_at, deleted) VALUES (5107072,0,'PLATFORM','BUTTON',5107092,'platform:overseas-warehouse:delivery:return','派送单标记退货',NULL,'POST',772,'ACTIVE',1,CURRENT_TIMESTAMP(3),CURRENT_TIMESTAMP(3),0);
@@ -6437,7 +6460,6 @@ INSERT INTO iam_permission (id, tenant_id, app_code, permission_type, parent_id,
INSERT INTO iam_permission (id, tenant_id, app_code, permission_type, parent_id, permission_code, permission_name, route_path, http_method, sort_no, status, built_in, created_at, updated_at, deleted) VALUES (5305020,0,'MERCHANT','MENU',5300000,'merchant:finance:account:view','资金账户','/finance/account','GET',50,'ACTIVE',1,CURRENT_TIMESTAMP(3),CURRENT_TIMESTAMP(3),0);
INSERT INTO iam_permission (id, tenant_id, app_code, permission_type, parent_id, permission_code, permission_name, route_path, http_method, sort_no, status, built_in, created_at, updated_at, deleted) VALUES (5305021,0,'MERCHANT','BUTTON',5305020,'merchant:finance:recharge:create','提交充值申请',NULL,'POST',10,'ACTIVE',1,CURRENT_TIMESTAMP(3),CURRENT_TIMESTAMP(3),0);
INSERT INTO iam_permission (id, tenant_id, app_code, permission_type, parent_id, permission_code, permission_name, route_path, http_method, sort_no, status, built_in, created_at, updated_at, deleted) VALUES (5306000,0,'MERCHANT','MENU',0,'merchant:warehouse:delivery:list','海外仓派送单','/orders/delivery','GET',60,'ACTIVE',1,CURRENT_TIMESTAMP(3),CURRENT_TIMESTAMP(3),0);
INSERT INTO iam_permission (id, tenant_id, app_code, permission_type, parent_id, permission_code, permission_name, route_path, http_method, sort_no, status, built_in, created_at, updated_at, deleted) VALUES (5306001,0,'MERCHANT','BUTTON',5306000,'merchant:warehouse:delivery:create','创建海外仓派送单',NULL,'POST',10,'ACTIVE',1,CURRENT_TIMESTAMP(3),CURRENT_TIMESTAMP(3),0);
INSERT INTO iam_permission (id, tenant_id, app_code, permission_type, parent_id, permission_code, permission_name, route_path, http_method, sort_no, status, built_in, created_at, updated_at, deleted) VALUES (5306100,0,'MERCHANT','MENU',0,'merchant:cross-border:procurement:list','海外采购','/cross-border/procurement','GET',70,'ACTIVE',1,CURRENT_TIMESTAMP(3),CURRENT_TIMESTAMP(3),0);
INSERT INTO iam_permission (id, tenant_id, app_code, permission_type, parent_id, permission_code, permission_name, route_path, http_method, sort_no, status, built_in, created_at, updated_at, deleted) VALUES (5306101,0,'MERCHANT','BUTTON',5306100,'merchant:cross-border:procurement:create','创建海外采购单',NULL,'POST',10,'ACTIVE',1,CURRENT_TIMESTAMP(3),CURRENT_TIMESTAMP(3),0);
INSERT INTO iam_permission (id, tenant_id, app_code, permission_type, parent_id, permission_code, permission_name, route_path, http_method, sort_no, status, built_in, created_at, updated_at, deleted) VALUES (5306110,0,'MERCHANT','MENU',0,'merchant:cross-border:domestic-trucking:list','美国本土卡','/cross-border/domestic-trucking','GET',80,'ACTIVE',1,CURRENT_TIMESTAMP(3),CURRENT_TIMESTAMP(3),0);
@@ -6706,11 +6728,16 @@ INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at)
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000001,5107001,0,CURRENT_TIMESTAMP(3));
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000001,5107002,0,CURRENT_TIMESTAMP(3));
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000001,5107003,0,CURRENT_TIMESTAMP(3));
INSERT INTO iam_permission (id, tenant_id, app_code, permission_type, parent_id, permission_code, permission_name, route_path, http_method, sort_no, status, built_in, created_at, updated_at, deleted) VALUES (5107280,0,'PLATFORM','MENU',0,'platform:appointment:list','预约列表','/appointment-calendar','GET',740,'ACTIVE',1,CURRENT_TIMESTAMP(3),CURRENT_TIMESTAMP(3),0);
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000001,5107280,0,CURRENT_TIMESTAMP(3));
INSERT INTO iam_permission (id, tenant_id, app_code, permission_type, parent_id, permission_code, permission_name, route_path, http_method, sort_no, status, built_in, created_at, updated_at, deleted) VALUES (5107281,0,'PLATFORM','BUTTON',5107280,'platform:appointment:delete','删除预约',NULL,'DELETE',741,'ACTIVE',1,CURRENT_TIMESTAMP(3),CURRENT_TIMESTAMP(3),0);
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000001,5107281,0,CURRENT_TIMESTAMP(3));
INSERT INTO iam_permission (id, tenant_id, app_code, permission_type, parent_id, permission_code, permission_name, route_path, http_method, sort_no, status, built_in, created_at, updated_at, deleted) VALUES (5107282,0,'PLATFORM','BUTTON',5107280,'platform:appointment:followup','记录预约跟进',NULL,'POST',742,'ACTIVE',1,CURRENT_TIMESTAMP(3),CURRENT_TIMESTAMP(3),0);
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000001,5107282,0,CURRENT_TIMESTAMP(3));
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000001,5107010,0,CURRENT_TIMESTAMP(3));
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000001,5107011,0,CURRENT_TIMESTAMP(3));
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000001,5107012,0,CURRENT_TIMESTAMP(3));
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000001,5107013,0,CURRENT_TIMESTAMP(3));
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000001,5107014,0,CURRENT_TIMESTAMP(3));
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000001,5107016,0,CURRENT_TIMESTAMP(3));
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000001,5107017,0,CURRENT_TIMESTAMP(3));
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000001,5107018,0,CURRENT_TIMESTAMP(3));
@@ -6734,6 +6761,9 @@ INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at)
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000001,5107062,0,CURRENT_TIMESTAMP(3));
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000001,5107063,0,CURRENT_TIMESTAMP(3));
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000001,5107064,0,CURRENT_TIMESTAMP(3));
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000001,5107065,0,CURRENT_TIMESTAMP(3));
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000001,5107066,0,CURRENT_TIMESTAMP(3));
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000001,5107067,0,CURRENT_TIMESTAMP(3));
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000001,5107070,0,CURRENT_TIMESTAMP(3));
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000001,5107071,0,CURRENT_TIMESTAMP(3));
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000001,5107072,0,CURRENT_TIMESTAMP(3));
@@ -7011,6 +7041,9 @@ INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at)
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000004,5107050,0,CURRENT_TIMESTAMP(3));
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000004,5107060,0,CURRENT_TIMESTAMP(3));
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000004,5107064,0,CURRENT_TIMESTAMP(3));
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000004,5107065,0,CURRENT_TIMESTAMP(3));
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000004,5107066,0,CURRENT_TIMESTAMP(3));
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000004,5107067,0,CURRENT_TIMESTAMP(3));
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000004,5107070,0,CURRENT_TIMESTAMP(3));
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000004,5107071,0,CURRENT_TIMESTAMP(3));
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000004,5107072,0,CURRENT_TIMESTAMP(3));
@@ -7094,7 +7127,6 @@ INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at)
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000100,5305020,0,CURRENT_TIMESTAMP(3));
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000100,5305021,0,CURRENT_TIMESTAMP(3));
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000100,5306000,0,CURRENT_TIMESTAMP(3));
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000100,5306001,0,CURRENT_TIMESTAMP(3));
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000100,5306100,0,CURRENT_TIMESTAMP(3));
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000100,5306101,0,CURRENT_TIMESTAMP(3));
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000100,5306110,0,CURRENT_TIMESTAMP(3));
@@ -7115,7 +7147,9 @@ INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at)
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000100,5306172,0,CURRENT_TIMESTAMP(3));
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000100,5306180,0,CURRENT_TIMESTAMP(3));
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000100,5306181,0,CURRENT_TIMESTAMP(3));
INSERT INTO iam_permission (id, tenant_id, app_code, permission_type, parent_id, permission_code, permission_name, route_path, http_method, sort_no, status, built_in, created_at, updated_at, deleted) VALUES (5306183,0,'MERCHANT','BUTTON',5306180,'merchant:overseas-warehouse:discard:confirm','确认废弃完成',NULL,'POST',30,'ACTIVE',1,CURRENT_TIMESTAMP(3),CURRENT_TIMESTAMP(3),0);
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000100,5306182,0,CURRENT_TIMESTAMP(3));
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000100,5306183,0,CURRENT_TIMESTAMP(3));
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000100,5306190,0,CURRENT_TIMESTAMP(3));
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000100,5306191,0,CURRENT_TIMESTAMP(3));
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000100,5306192,0,CURRENT_TIMESTAMP(3));
@@ -7135,324 +7169,324 @@ INSERT INTO wh_service_capability (id, tenant_id, warehouse_id, capability_code,
INSERT INTO wh_service_capability (id, tenant_id, warehouse_id, capability_code, capability_name, enabled, cutoff_time, description, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000400004,0,193000000000200004,'RECEIVING','海外收货',1,'16:00:00','纽约仓海外接柜入仓收货能力',NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
-- 系统基线 wh_warehouse:318 行。
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000001,0,'ABE2',NULL,'ABE2','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000002,0,'ABE3',NULL,'ABE3','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000003,0,'ABE4','126','ABE4','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000004,0,'ABE5',NULL,'ABE5','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000005,0,'ABE8','39','ABE8','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000006,0,'ABQ2','76','ABQ2','FBA','US','UTC-7',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000007,0,'ACY2','101','ACY2','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000008,0,'AFW1',NULL,'AFW1','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000009,0,'AFW5','181','AFW5','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000010,0,'AKR1','153','AKR1','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000011,0,'ALB1','102','ALB1','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000012,0,'AMA1','132','AMA1','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000013,0,'ATL2N','157','ATL2N','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000014,0,'ATL3',NULL,'ATL3','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000015,0,'ATL6',NULL,'ATL6','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000016,0,'AVP1','70','AVP1','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000017,0,'AVP3',NULL,'AVP3','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000018,0,'BDL1',NULL,'BDL1','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000019,0,'BFI1',NULL,'BFI1','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000020,0,'BFI3','34','BFI3','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000021,0,'BFI7',NULL,'BFI7','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000022,0,'BJC1','186','BJC1','FBA','US','UTC-7',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000023,0,'BNA1',NULL,'BNA1','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000024,0,'BNA2','37','BNA2','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000025,0,'BNA3',NULL,'BNA3','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000026,0,'BNA4',NULL,'BNA4','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000027,0,'BNA6','99','BNA6','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000028,0,'BOS1',NULL,'BOS1','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000029,0,'BOS2',NULL,'BOS2','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000030,0,'BOS7','103','BOS7','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000031,0,'BWI1',NULL,'BWI1','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000032,0,'BWI2',NULL,'BWI2','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000033,0,'BWI4','150','BWI4','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000034,0,'CAE1',NULL,'CAE1','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000035,0,'CHA1',NULL,'CHA1','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000036,0,'CHA2','66','CHA2','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000037,0,'CHO1','120','CHO1','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000038,0,'CLT2','59','CLT2','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000039,0,'CLT3','104','CLT3','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000040,0,'CMH2','123','CMH2','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000041,0,'CMH3','32','CMH3','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000042,0,'CVG1',NULL,'CVG1','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000043,0,'CVG2',NULL,'CVG2','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000044,0,'CVG3',NULL,'CVG3','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000045,0,'CVG5',NULL,'CVG5','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000046,0,'DCA6','135','DCA6','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000047,0,'DEN2','107','DEN2','FBA','US','UTC-7',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000048,0,'DEN8','73','DEN8','FBA','US','UTC-7',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000049,0,'DET1','118','DET1','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000050,0,'DET2','136','DET2','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000051,0,'DFW5S',NULL,'DFW5S','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000052,0,'DFW6','105','DFW6','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000053,0,'DFW8',NULL,'DFW8','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000054,0,'EWR4',NULL,'EWR4','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000055,0,'EWR5',NULL,'EWR5','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000056,0,'EWR7',NULL,'EWR7','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000057,0,'EWR9',NULL,'EWR9','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000058,0,'FAT2','43','FAT2','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000059,0,'FOE1','117','FOE1','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000060,0,'FTW1','24','FTW1','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000061,0,'FTW2',NULL,'FTW2','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000062,0,'FTW3',NULL,'FTW3','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000063,0,'FTW5','48','FTW5','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000064,0,'FWA4','58','FWA4','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000065,0,'GEG2','108','GEG2','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000066,0,'GEU2','97','GEU2','FBA','US','UTC-7',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000067,0,'GEU3','81','GEU3','FBA','US','UTC-7',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000068,0,'GEU5','100','GEU5','FBA','US','UTC-7',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000069,0,'GSO1','131','GSO1','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000070,0,'GSP1','90','GSP1','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000071,0,'GYR2','7','GYR2','FBA','US','UTC-7',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000072,0,'GYR3','8','GYR3','FBA','US','UTC-7',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000073,0,'HGR6','130','HGR6','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000074,0,'HIA1','148','HIA1','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000075,0,'HLI2','137','HLI2','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000076,0,'HOU1',NULL,'HOU1','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000077,0,'HOU2',NULL,'HOU2','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000078,0,'HOU3',NULL,'HOU3','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000079,0,'HOU8','49','HOU8','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000080,0,'HSV1','80','HSV1','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000081,0,'HSV2',NULL,'HSV2','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000082,0,'IAH3','57','IAH3','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000083,0,'IAZ1','179','IAZ1','FBA','US','UTC-7',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000084,0,'ICT2','109','ICT2','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000085,0,'IGA3','197','IGA3','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000086,0,'IGQ2','110','IGQ2','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000087,0,'ILG1','35','ILG1','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000088,0,'IMO1','178','IMO1','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000089,0,'IMS1','189','IMS1','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000090,0,'INC1','190','INC1','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000091,0,'IND2','127','IND2','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000092,0,'IND4',NULL,'IND4','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000093,0,'IND5','140','IND5','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000094,0,'IND6',NULL,'IND6','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000095,0,'IND9','17','IND9','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000096,0,'ITX3','187','ITX3','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000097,0,'IUSF','169','IUSF','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000098,0,'IUSJ','98','IUSJ','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000099,0,'IUSP','83','IUSP','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000100,0,'IUSQ','95','IUSQ','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000101,0,'IUSR','158','IUSR','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000102,0,'IUST','149','IUST','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000103,0,'IUSW','156','IUSW','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000104,0,'IUTE','170','IUTE','FBA','US','UTC-7',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000105,0,'IUTJ','177','IUTJ','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000106,0,'IUTL','188','IUTL','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000107,0,'IWA6','191','IWA6','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000108,0,'JOT1','93','JOT1','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000109,0,'JVL1','125','JVL1','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000110,0,'KRB4',NULL,'KRB4','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000111,0,'KY1','60','KY1','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000112,0,'LAN2','96','LAN2','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000113,0,'LAS1','5','LAS1','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000114,0,'LAS2',NULL,'LAS2','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000115,0,'LAS6','50','LAS6','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000116,0,'LAX2T','19','LAX2T','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000117,0,'LAX9','3','LAX9','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000118,0,'LBE1','112','LBE1','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000119,0,'LEX1',NULL,'LEX1','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000120,0,'LEX2',NULL,'LEX2','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000121,0,'LFT1','31','LFT1','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000122,0,'LGB3',NULL,'LGB3','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000123,0,'LGB4','45','LGB4','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000124,0,'LGB6','26','LGB6','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000125,0,'LGB8','2','LGB8','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000126,0,'LIT2','159','LIT2','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000127,0,'MCC1','161','MCC1','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000128,0,'MCE1','65','MCE1','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000129,0,'MCI1',NULL,'MCI1','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000130,0,'MCI4','176','MCI4','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000131,0,'MCO2','106','MCO2','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000132,0,'MDT1','121','MDT1','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000133,0,'MDT4','144','MDT4','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000134,0,'MDW2','46','MDW2','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000135,0,'MDW6','143','MDW6','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000136,0,'MDW7',NULL,'MDW7','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000137,0,'MDW8',NULL,'MDW8','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000138,0,'MDW9','36','MDW9','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000139,0,'MEM1','85','MEM1','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000140,0,'MEM6','51','MEM6','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000141,0,'MGE3','133','MGE3','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000142,0,'MIT2','82','MIT2','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000143,0,'MKC4','67','MKC4','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000144,0,'MKC6',NULL,'MKC6','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000145,0,'MKE1',NULL,'MKE1','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000146,0,'MQJ1','88','MQJ1','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000147,0,'MSP1',NULL,'MSP1','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000148,0,'NJ3','175','NJ3','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000149,0,'OAK3','41','OAK3','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000150,0,'OAK4',NULL,'OAK4','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000151,0,'OKC2','33','OKC2','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000152,0,'OLM1','172','OLM1','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000153,0,'ONT2',NULL,'ONT2','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000154,0,'ONT6',NULL,'ONT6','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000155,0,'ONT8','1','ONT8','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000156,0,'ONT9','25','ONT9','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000157,0,'ORD2','21','ORD2','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000158,0,'ORD6',NULL,'ORD6','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000159,0,'ORF2','38','ORF2','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000160,0,'PBI3','113','PBI3','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000161,0,'PDX7','68','PDX7','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000162,0,'PHL1',NULL,'PHL1','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000163,0,'PHL3',NULL,'PHL3','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000164,0,'PHL4','52','PHL4','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000165,0,'PHL5',NULL,'PHL5','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000166,0,'PHL5S','171','PHL5S','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000167,0,'PHL6','69','PHL6','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000168,0,'PHL7',NULL,'PHL7','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000169,0,'PHL8',NULL,'PHL8','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000170,0,'PHX3',NULL,'PHX3','FBA','US','UTC-7',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000171,0,'PHX5','72','PHX5','FBA','US','UTC-7',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000172,0,'PHX6',NULL,'PHX6','FBA','US','UTC-7',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000173,0,'PHX7','74','PHX7','FBA','US','UTC-7',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000174,0,'PIT1',NULL,'PIT1','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000175,0,'PIT2','78','PIT2','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000176,0,'POC1','128','POC1','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000177,0,'POC2','151','POC2','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000178,0,'POC3','129','POC3','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000179,0,'PPO4','122','PPO4','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000180,0,'PSC2','75','PSC2','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000181,0,'PSP3','162','PSP3','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000182,0,'QXY5','92','QXY5','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000183,0,'QXY8','154','QXY8','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000184,0,'QZZ7','184','QZZ7','FBA','US','UTC-7',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000185,0,'RDU2','56','RDU2','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000186,0,'RDU4','145','RDU4','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000187,0,'RFD2','71','RFD2','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000188,0,'RFD4','174','RFD4','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000189,0,'RIC1','142','RIC1','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000190,0,'RIC2',NULL,'RIC2','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000191,0,'RMN3','84','RMN3','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000192,0,'RNO1',NULL,'RNO1','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000193,0,'RNO2',NULL,'RNO2','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000194,0,'RNO4',NULL,'RNO4','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000195,0,'RYY2','94','RYY2','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000196,0,'SAT1','23','SAT1','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000197,0,'SAT4','61','SAT4','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000198,0,'SAT6','183','SAT6','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000199,0,'SAV3','124','SAV3','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000200,0,'SBD1','4','SBD1','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000201,0,'SBD2','15','SBD2','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000202,0,'SCK1','20','SCK1','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000203,0,'SCK3','54','SCK3','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000204,0,'SCK4','10','SCK4','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000205,0,'SCK8','141','SCK8','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000206,0,'SDF1',NULL,'SDF1','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000207,0,'SDF2',NULL,'SDF2','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000208,0,'SDF4',NULL,'SDF4','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000209,0,'SDF6',NULL,'SDF6','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000210,0,'SDF7',NULL,'SDF7','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000211,0,'SDF8',NULL,'SDF8','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000212,0,'SDF9',NULL,'SDF9','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000213,0,'SEA6',NULL,'SEA6','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000214,0,'SEA8',NULL,'SEA8','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000215,0,'SJC7','30','SJC7','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000216,0,'SLC2','86','SLC2','FBA','US','UTC-7',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000217,0,'SLC3','185','SLC3','FBA','US','UTC-7',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000218,0,'SMF3','9','SMF3','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000219,0,'SMF6','28','SMF6','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000220,0,'SNA4','18','SNA4','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000221,0,'STL3','152','STL3','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000222,0,'STL4','115','STL4','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000223,0,'SWF1','134','SWF1','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000224,0,'SWF2','62','SWF2','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000225,0,'TCY1','139','TCY1','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000226,0,'TCY2','138','TCY2','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000227,0,'TEB3','47','TEB3','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000228,0,'TEB4','55','TEB4','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000229,0,'TEB6','114','TEB6','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000230,0,'TEB9','40','TEB9','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000231,0,'TMB8','116','TMB8','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000232,0,'TOL3','173','TOL3','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000233,0,'TPA1',NULL,'TPA1','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000234,0,'TPA2','22','TPA2','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000235,0,'TPA3','146','TPA3','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000236,0,'TUL1',NULL,'TUL1','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000237,0,'VGT2','6','VGT2','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000238,0,'VUBA',NULL,'VUBA','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000239,0,'VUGA',NULL,'VUGA','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000240,0,'WBW2','119','WBW2','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000241,0,'XAV3','180','XAV3','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000242,0,'XEW5','163','XEW5','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000243,0,'XIN5','182','XIN5','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000244,0,'XLX1','160','XLX1','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000245,0,'XLX6','166','XLX6','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000246,0,'XLX7','27','XLX7','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000247,0,'XPB2','165','XPB2','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000248,0,'XRI3','167','XRI3','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000249,0,'XUSB',NULL,'XUSB','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000250,0,'XUSC',NULL,'XUSC','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000251,0,'XUSD',NULL,'XUSD','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000252,0,'XUSE',NULL,'XUSE','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000253,0,'ABE8-309',NULL,'ABE8-309','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000254,0,'ABE8-401',NULL,'ABE8-401','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000255,0,'ABQ2-UPS',NULL,'ABQ2-UPS','FBA','US','UTC-7',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000256,0,'ATL1','200','ATL1','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000257,0,'ATL1-WALMART',NULL,'ATL1-WALMART','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000001,0,'ABE2',NULL,'ABE2','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000002,0,'ABE3',NULL,'ABE3','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000003,0,'ABE4','126','ABE4','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000004,0,'ABE5',NULL,'ABE5','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000005,0,'ABE8','39','ABE8','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000006,0,'ABQ2','76','ABQ2','FBA','US','America/Denver',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000007,0,'ACY2','101','ACY2','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000008,0,'AFW1',NULL,'AFW1','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000009,0,'AFW5','181','AFW5','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000010,0,'AKR1','153','AKR1','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000011,0,'ALB1','102','ALB1','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000012,0,'AMA1','132','AMA1','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000013,0,'ATL2N','157','ATL2N','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000014,0,'ATL3',NULL,'ATL3','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000015,0,'ATL6',NULL,'ATL6','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000016,0,'AVP1','70','AVP1','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000017,0,'AVP3',NULL,'AVP3','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000018,0,'BDL1',NULL,'BDL1','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000019,0,'BFI1',NULL,'BFI1','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000020,0,'BFI3','34','BFI3','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000021,0,'BFI7',NULL,'BFI7','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000022,0,'BJC1','186','BJC1','FBA','US','America/Denver',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000023,0,'BNA1',NULL,'BNA1','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000024,0,'BNA2','37','BNA2','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000025,0,'BNA3',NULL,'BNA3','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000026,0,'BNA4',NULL,'BNA4','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000027,0,'BNA6','99','BNA6','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000028,0,'BOS1',NULL,'BOS1','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000029,0,'BOS2',NULL,'BOS2','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000030,0,'BOS7','103','BOS7','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000031,0,'BWI1',NULL,'BWI1','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000032,0,'BWI2',NULL,'BWI2','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000033,0,'BWI4','150','BWI4','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000034,0,'CAE1',NULL,'CAE1','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000035,0,'CHA1',NULL,'CHA1','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000036,0,'CHA2','66','CHA2','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000037,0,'CHO1','120','CHO1','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000038,0,'CLT2','59','CLT2','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000039,0,'CLT3','104','CLT3','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000040,0,'CMH2','123','CMH2','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000041,0,'CMH3','32','CMH3','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000042,0,'CVG1',NULL,'CVG1','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000043,0,'CVG2',NULL,'CVG2','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000044,0,'CVG3',NULL,'CVG3','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000045,0,'CVG5',NULL,'CVG5','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000046,0,'DCA6','135','DCA6','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000047,0,'DEN2','107','DEN2','FBA','US','America/Denver',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000048,0,'DEN8','73','DEN8','FBA','US','America/Denver',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000049,0,'DET1','118','DET1','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000050,0,'DET2','136','DET2','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000051,0,'DFW5S',NULL,'DFW5S','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000052,0,'DFW6','105','DFW6','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000053,0,'DFW8',NULL,'DFW8','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000054,0,'EWR4',NULL,'EWR4','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000055,0,'EWR5',NULL,'EWR5','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000056,0,'EWR7',NULL,'EWR7','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000057,0,'EWR9',NULL,'EWR9','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000058,0,'FAT2','43','FAT2','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000059,0,'FOE1','117','FOE1','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000060,0,'FTW1','24','FTW1','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000061,0,'FTW2',NULL,'FTW2','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000062,0,'FTW3',NULL,'FTW3','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000063,0,'FTW5','48','FTW5','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000064,0,'FWA4','58','FWA4','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000065,0,'GEG2','108','GEG2','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000066,0,'GEU2','97','GEU2','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000067,0,'GEU3','81','GEU3','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000068,0,'GEU5','100','GEU5','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000069,0,'GSO1','131','GSO1','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000070,0,'GSP1','90','GSP1','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000071,0,'GYR2','7','GYR2','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000072,0,'GYR3','8','GYR3','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000073,0,'HGR6','130','HGR6','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000074,0,'HIA1','148','HIA1','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000075,0,'HLI2','137','HLI2','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000076,0,'HOU1',NULL,'HOU1','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000077,0,'HOU2',NULL,'HOU2','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000078,0,'HOU3',NULL,'HOU3','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000079,0,'HOU8','49','HOU8','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000080,0,'HSV1','80','HSV1','FBA','US','America/Chicago',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000081,0,'HSV2',NULL,'HSV2','FBA','US','America/Chicago',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000082,0,'IAH3','57','IAH3','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000083,0,'IAZ1','179','IAZ1','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000084,0,'ICT2','109','ICT2','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000085,0,'IGA3','197','IGA3','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000086,0,'IGQ2','110','IGQ2','FBA','US','America/Chicago',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000087,0,'ILG1','35','ILG1','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000088,0,'IMO1','178','IMO1','FBA','US','America/Chicago',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000089,0,'IMS1','189','IMS1','FBA','US','America/Chicago',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000090,0,'INC1','190','INC1','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000091,0,'IND2','127','IND2','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000092,0,'IND4',NULL,'IND4','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000093,0,'IND5','140','IND5','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000094,0,'IND6',NULL,'IND6','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000095,0,'IND9','17','IND9','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000096,0,'ITX3','187','ITX3','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000097,0,'IUSF','169','IUSF','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000098,0,'IUSJ','98','IUSJ','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000099,0,'IUSP','83','IUSP','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000100,0,'IUSQ','95','IUSQ','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000101,0,'IUSR','158','IUSR','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000102,0,'IUST','149','IUST','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000103,0,'IUSW','156','IUSW','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000104,0,'IUTE','170','IUTE','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000105,0,'IUTJ','177','IUTJ','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000106,0,'IUTL','188','IUTL','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000107,0,'IWA6','191','IWA6','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000108,0,'JOT1','93','JOT1','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000109,0,'JVL1','125','JVL1','FBA','US','America/Chicago',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000110,0,'KRB4',NULL,'KRB4','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000111,0,'KY1','60','KY1','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000112,0,'LAN2','96','LAN2','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000113,0,'LAS1','5','LAS1','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000114,0,'LAS2',NULL,'LAS2','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000115,0,'LAS6','50','LAS6','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000116,0,'LAX2T','19','LAX2T','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000117,0,'LAX9','3','LAX9','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000118,0,'LBE1','112','LBE1','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000119,0,'LEX1',NULL,'LEX1','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000120,0,'LEX2',NULL,'LEX2','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000121,0,'LFT1','31','LFT1','FBA','US','America/Chicago',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000122,0,'LGB3',NULL,'LGB3','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000123,0,'LGB4','45','LGB4','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000124,0,'LGB6','26','LGB6','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000125,0,'LGB8','2','LGB8','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000126,0,'LIT2','159','LIT2','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000127,0,'MCC1','161','MCC1','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000128,0,'MCE1','65','MCE1','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000129,0,'MCI1',NULL,'MCI1','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000130,0,'MCI4','176','MCI4','FBA','US','America/Chicago',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000131,0,'MCO2','106','MCO2','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000132,0,'MDT1','121','MDT1','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000133,0,'MDT4','144','MDT4','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000134,0,'MDW2','46','MDW2','FBA','US','America/Chicago',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000135,0,'MDW6','143','MDW6','FBA','US','America/Chicago',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000136,0,'MDW7',NULL,'MDW7','FBA','US','America/Chicago',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000137,0,'MDW8',NULL,'MDW8','FBA','US','America/Chicago',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000138,0,'MDW9','36','MDW9','FBA','US','America/Chicago',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000139,0,'MEM1','85','MEM1','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000140,0,'MEM6','51','MEM6','FBA','US','America/Chicago',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000141,0,'MGE3','133','MGE3','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000142,0,'MIT2','82','MIT2','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000143,0,'MKC4','67','MKC4','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000144,0,'MKC6',NULL,'MKC6','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000145,0,'MKE1',NULL,'MKE1','FBA','US','America/Chicago',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000146,0,'MQJ1','88','MQJ1','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000147,0,'MSP1',NULL,'MSP1','FBA','US','America/Chicago',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000148,0,'NJ3','175','NJ3','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000149,0,'OAK3','41','OAK3','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000150,0,'OAK4',NULL,'OAK4','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000151,0,'OKC2','33','OKC2','FBA','US','America/Chicago',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000152,0,'OLM1','172','OLM1','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000153,0,'ONT2',NULL,'ONT2','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000154,0,'ONT6',NULL,'ONT6','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000155,0,'ONT8','1','ONT8','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000156,0,'ONT9','25','ONT9','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000157,0,'ORD2','21','ORD2','FBA','US','America/Chicago',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000158,0,'ORD6',NULL,'ORD6','FBA','US','America/Chicago',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000159,0,'ORF2','38','ORF2','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000160,0,'PBI3','113','PBI3','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000161,0,'PDX7','68','PDX7','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000162,0,'PHL1',NULL,'PHL1','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000163,0,'PHL3',NULL,'PHL3','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000164,0,'PHL4','52','PHL4','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000165,0,'PHL5',NULL,'PHL5','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000166,0,'PHL5S','171','PHL5S','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000167,0,'PHL6','69','PHL6','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000168,0,'PHL7',NULL,'PHL7','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000169,0,'PHL8',NULL,'PHL8','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000170,0,'PHX3',NULL,'PHX3','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000171,0,'PHX5','72','PHX5','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000172,0,'PHX6',NULL,'PHX6','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000173,0,'PHX7','74','PHX7','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000174,0,'PIT1',NULL,'PIT1','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000175,0,'PIT2','78','PIT2','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000176,0,'POC1','128','POC1','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000177,0,'POC2','151','POC2','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000178,0,'POC3','129','POC3','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000179,0,'PPO4','122','PPO4','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000180,0,'PSC2','75','PSC2','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000181,0,'PSP3','162','PSP3','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000182,0,'QXY5','92','QXY5','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000183,0,'QXY8','154','QXY8','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000184,0,'QZZ7','184','QZZ7','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000185,0,'RDU2','56','RDU2','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000186,0,'RDU4','145','RDU4','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000187,0,'RFD2','71','RFD2','FBA','US','America/Chicago',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000188,0,'RFD4','174','RFD4','FBA','US','America/Chicago',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000189,0,'RIC1','142','RIC1','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000190,0,'RIC2',NULL,'RIC2','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000191,0,'RMN3','84','RMN3','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000192,0,'RNO1',NULL,'RNO1','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000193,0,'RNO2',NULL,'RNO2','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000194,0,'RNO4',NULL,'RNO4','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000195,0,'RYY2','94','RYY2','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000196,0,'SAT1','23','SAT1','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000197,0,'SAT4','61','SAT4','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000198,0,'SAT6','183','SAT6','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000199,0,'SAV3','124','SAV3','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000200,0,'SBD1','4','SBD1','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000201,0,'SBD2','15','SBD2','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000202,0,'SCK1','20','SCK1','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000203,0,'SCK3','54','SCK3','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000204,0,'SCK4','10','SCK4','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000205,0,'SCK8','141','SCK8','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000206,0,'SDF1',NULL,'SDF1','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000207,0,'SDF2',NULL,'SDF2','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000208,0,'SDF4',NULL,'SDF4','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000209,0,'SDF6',NULL,'SDF6','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000210,0,'SDF7',NULL,'SDF7','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000211,0,'SDF8',NULL,'SDF8','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000212,0,'SDF9',NULL,'SDF9','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000213,0,'SEA6',NULL,'SEA6','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000214,0,'SEA8',NULL,'SEA8','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000215,0,'SJC7','30','SJC7','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000216,0,'SLC2','86','SLC2','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000217,0,'SLC3','185','SLC3','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000218,0,'SMF3','9','SMF3','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000219,0,'SMF6','28','SMF6','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000220,0,'SNA4','18','SNA4','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000221,0,'STL3','152','STL3','FBA','US','America/Chicago',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000222,0,'STL4','115','STL4','FBA','US','America/Chicago',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000223,0,'SWF1','134','SWF1','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000224,0,'SWF2','62','SWF2','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000225,0,'TCY1','139','TCY1','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000226,0,'TCY2','138','TCY2','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000227,0,'TEB3','47','TEB3','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000228,0,'TEB4','55','TEB4','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000229,0,'TEB6','114','TEB6','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000230,0,'TEB9','40','TEB9','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000231,0,'TMB8','116','TMB8','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000232,0,'TOL3','173','TOL3','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000233,0,'TPA1',NULL,'TPA1','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000234,0,'TPA2','22','TPA2','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000235,0,'TPA3','146','TPA3','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000236,0,'TUL1',NULL,'TUL1','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000237,0,'VGT2','6','VGT2','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000238,0,'VUBA',NULL,'VUBA','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000239,0,'VUGA',NULL,'VUGA','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000240,0,'WBW2','119','WBW2','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000241,0,'XAV3','180','XAV3','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000242,0,'XEW5','163','XEW5','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000243,0,'XIN5','182','XIN5','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000244,0,'XLX1','160','XLX1','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000245,0,'XLX6','166','XLX6','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000246,0,'XLX7','27','XLX7','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000247,0,'XPB2','165','XPB2','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000248,0,'XRI3','167','XRI3','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000249,0,'XUSB',NULL,'XUSB','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000250,0,'XUSC',NULL,'XUSC','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000251,0,'XUSD',NULL,'XUSD','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000252,0,'XUSE',NULL,'XUSE','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000253,0,'ABE8-309',NULL,'ABE8-309','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000254,0,'ABE8-401',NULL,'ABE8-401','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000255,0,'ABQ2-UPS',NULL,'ABQ2-UPS','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000256,0,'ATL1','200','ATL1','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000257,0,'ATL1-WALMART',NULL,'ATL1-WALMART','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000258,0,'AZA4','16','AZA4','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000259,0,'CEG2','79','CEG2','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000260,0,'CMH1-11999',NULL,'CMH1-11999','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000260,0,'CMH1-11999',NULL,'CMH1-11999','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000261,0,'FEDEX','12','FEDEX','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000262,0,'HEA2','77','HEA2','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000263,0,'HOU7','63','HOU7','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000264,0,'IAK3','44','IAK3','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000265,0,'IMI1','199','IMI1','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000266,0,'IND1-AMAZON',NULL,'IND1-AMAZON','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000267,0,'IND1-WALMART',NULL,'IND1-WALMART','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000268,0,'IND2-AMAZON',NULL,'IND2-AMAZON','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000269,0,'IND2-WALMART',NULL,'IND2-WALMART','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000270,0,'IND3','198','IND3','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000265,0,'IMI1','199','IMI1','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000266,0,'IND1-AMAZON',NULL,'IND1-AMAZON','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000267,0,'IND1-WALMART',NULL,'IND1-WALMART','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000268,0,'IND2-AMAZON',NULL,'IND2-AMAZON','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000269,0,'IND2-WALMART',NULL,'IND2-WALMART','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000270,0,'IND3','198','IND3','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000271,0,'IND3-亚马逊',NULL,'IND3-亚马逊','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000272,0,'IND3-沃尔玛',NULL,'IND3-沃尔玛','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000273,0,'IPA1','194','IPA1','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000274,0,'IUSP-AWD','83','IUSP-AWD','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000272,0,'IND3-沃尔玛',NULL,'IND3-沃尔玛','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000273,0,'IPA1','194','IPA1','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000274,0,'IUSP-AWD','83','IUSP-AWD','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000275,0,'JAX3','111','JAX3','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000276,0,'JAX3-32210','111','JAX3-32210','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000277,0,'JAX3-32221',NULL,'JAX3-32221','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000278,0,'LAN2-48917',NULL,'LAN2-48917','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000279,0,'LAX1','192','LAX1','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000280,0,'LAX1-WALMART',NULL,'LAX1-WALMART','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000281,0,'LAX2T-WALMART',NULL,'LAX2T-WALMART','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000282,0,'LBE1-UPS',NULL,'LBE1-UPS','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000283,0,'MCO1-WALMART',NULL,'MCO1-WALMART','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000284,0,'MDW2-60433-3280',NULL,'MDW2-60433-3280','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000285,0,'MEM1S-WALMART',NULL,'MEM1S-WALMART','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000286,0,'MIA1-33054',NULL,'MIA1-33054','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000287,0,'MIA1-33182',NULL,'MIA1-33182','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000288,0,'MQY2','193','MQY2','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000289,0,'NJ3-WALMART',NULL,'NJ3-WALMART','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000290,0,'NJ3T','195','NJ3T','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000291,0,'ORD1S-WALMART',NULL,'ORD1S-WALMART','FBA','US','UTC-6',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000292,0,'ORF2-FEDEX',NULL,'ORF2-FEDEX','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000293,0,'ORF2-UPS',NULL,'ORF2-UPS','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000294,0,'PHL5S-WALMART',NULL,'PHL5S-WALMART','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000295,0,'PSC2-UPS',NULL,'PSC2-UPS','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000296,0,'SLC1N','196','SLC1N','FBA','US','UTC-7',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000297,0,'SMF1-AMAZON',NULL,'SMF1-AMAZON','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000298,0,'SMF1-WALMART',NULL,'SMF1-WALMART','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000276,0,'JAX3-32210','111','JAX3-32210','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000277,0,'JAX3-32221',NULL,'JAX3-32221','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000278,0,'LAN2-48917',NULL,'LAN2-48917','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000279,0,'LAX1','192','LAX1','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000280,0,'LAX1-WALMART',NULL,'LAX1-WALMART','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000281,0,'LAX2T-WALMART',NULL,'LAX2T-WALMART','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000282,0,'LBE1-UPS',NULL,'LBE1-UPS','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000283,0,'MCO1-WALMART',NULL,'MCO1-WALMART','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000284,0,'MDW2-60433-3280',NULL,'MDW2-60433-3280','FBA','US','America/Chicago',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000285,0,'MEM1S-WALMART',NULL,'MEM1S-WALMART','FBA','US','America/Chicago',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000286,0,'MIA1-33054',NULL,'MIA1-33054','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000287,0,'MIA1-33182',NULL,'MIA1-33182','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000288,0,'MQY2','193','MQY2','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000289,0,'NJ3-WALMART',NULL,'NJ3-WALMART','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000290,0,'NJ3T','195','NJ3T','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000291,0,'ORD1S-WALMART',NULL,'ORD1S-WALMART','FBA','US','America/Chicago',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000292,0,'ORF2-FEDEX',NULL,'ORF2-FEDEX','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000293,0,'ORF2-UPS',NULL,'ORF2-UPS','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000294,0,'PHL5S-WALMART',NULL,'PHL5S-WALMART','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000295,0,'PSC2-UPS',NULL,'PSC2-UPS','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000296,0,'SLC1N','196','SLC1N','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000297,0,'SMF1-AMAZON',NULL,'SMF1-AMAZON','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000298,0,'SMF1-WALMART',NULL,'SMF1-WALMART','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000299,0,'SMF7','53','SMF7','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000300,0,'STL6','64','STL6','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000301,0,'SWF2-10710',NULL,'SWF2-10710','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000302,0,'SWF2-12533',NULL,'SWF2-12533','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000303,0,'TMB8-UPS',NULL,'TMB8-UPS','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000301,0,'SWF2-10710',NULL,'SWF2-10710','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000302,0,'SWF2-12533',NULL,'SWF2-12533','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000303,0,'TMB8-UPS',NULL,'TMB8-UPS','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000304,0,'UPS','11','UPS','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000305,0,'VGT2-FEDEX',NULL,'VGT2-FEDEX','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000306,0,'VGT2-UPS',NULL,'VGT2-UPS','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000305,0,'VGT2-FEDEX',NULL,'VGT2-FEDEX','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000306,0,'VGT2-UPS',NULL,'VGT2-UPS','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000307,0,'XBN3','91','XBN3','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000308,0,'XCH2','87','XCH2','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000309,0,'XMI3','89','XMI3','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000310,0,'洛杉矶仓一件代发','CADF','洛杉矶仓一件代发','FBA','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000310,0,'洛杉矶仓一件代发','CADF','洛杉矶仓一件代发','FBA','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000311,0,'海外仓打托','13','海外仓打托','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000312,0,'私人仓','14','私人仓','FBA','US','',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000313,0,'纽约仓',NULL,'纽约仓','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000314,0,'纽约仓一件代发','NJDF','纽约仓一件代发','FBA','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000200001,0,'CN-YIWU-01',NULL,'义乌仓','DOMESTIC','CN','UTC+8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000200002,0,'CN-DONGGUAN-01',NULL,'东莞仓','DOMESTIC','CN','UTC+8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000200003,0,'US-LAX-01',NULL,'洛杉矶仓','OVERSEAS','US','UTC-8',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000200004,0,'US-NYC-01',NULL,'纽约仓','OVERSEAS','US','UTC-5',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000313,0,'纽约仓',NULL,'纽约仓','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000000314,0,'纽约仓一件代发','NJDF','纽约仓一件代发','FBA','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000200001,0,'CN-YIWU-01',NULL,'义乌仓','DOMESTIC','CN','Asia/Shanghai',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000200002,0,'CN-DONGGUAN-01',NULL,'东莞仓','DOMESTIC','CN','Asia/Shanghai',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000200003,0,'US-LAX-01',NULL,'洛杉矶仓','OVERSEAS','US','America/Los_Angeles',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
INSERT INTO wh_warehouse (id, tenant_id, warehouse_code, internal_code, warehouse_name, warehouse_type, country_code, timezone, contact_name, contact_phone, contact_email, status, remark, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000200004,0,'US-NYC-01',NULL,'纽约仓','OVERSEAS','US','America/New_York',NULL,NULL,NULL,'ACTIVE',NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
-- 系统基线 wh_warehouse_address:318 行。
INSERT INTO wh_warehouse_address (id, tenant_id, warehouse_id, address_type, country_code, state_province, city, district, postal_code, address_line1, address_line2, latitude, longitude, created_by, created_at, updated_by, updated_at, deleted, version) VALUES (193000000000100001,0,193000000000000001,'OPERATING','US','PA','Breinigsville',NULL,'18031','705 Boulder Drive',NULL,NULL,NULL,NULL,CURRENT_TIMESTAMP(3),NULL,CURRENT_TIMESTAMP(3),0,0);
@@ -8278,4 +8312,62 @@ CREATE TABLE event_delivery_attempt (
KEY idx_delivery_attempt_outcome (outcome,started_at)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='本服务业务事件逐次投递审计';
SELECT 'PASS' AS initialization_status, 'CN' AS region, 226 AS initialized_tables;
USE baiyue_iam;
-- 采购节点动作独立授权;不新建岗位,不以通用编辑权限代替购买与取消。
INSERT INTO iam_permission(id,tenant_id,app_code,permission_type,parent_id,permission_code,permission_name,route_path,http_method,sort_no,status,built_in,deleted)
VALUES
(5117103,0,'PLATFORM','BUTTON',5107100,'platform:overseas-business:purchase:buy','采购购买及货款核定',NULL,'POST',803,'ACTIVE',1,0),
(5117104,0,'PLATFORM','BUTTON',5107100,'platform:overseas-business:purchase:cancel','购买前取消采购订单',NULL,'POST',804,'ACTIVE',1,0),
(5117105,0,'PLATFORM','BUTTON',5107100,'platform:overseas-business:purchase:receive-overseas','采购海外收货',NULL,'POST',805,'ACTIVE',1,0),
(5117106,0,'PLATFORM','BUTTON',5107100,'platform:overseas-business:purchase:receive-domestic','采购国内收货',NULL,'POST',806,'ACTIVE',1,0),
(5117107,0,'PLATFORM','BUTTON',5107100,'platform:overseas-business:purchase:pack','采购装箱与确认',NULL,'POST',807,'ACTIVE',1,0),
(5117108,0,'PLATFORM','BUTTON',5107100,'platform:overseas-business:purchase:manage','采购差异处置与事实更正',NULL,'POST',808,'ACTIVE',1,0),
(5117109,0,'PLATFORM','BUTTON',5107100,'platform:overseas-business:purchase:label','采购面单维护',NULL,'POST',809,'ACTIVE',1,0),
(5117110,0,'PLATFORM','BUTTON',5107100,'platform:overseas-business:purchase:charge','采购国内核费',NULL,'POST',810,'ACTIVE',1,0),
(5117111,0,'PLATFORM','BUTTON',5107100,'platform:overseas-business:purchase:finance-adjust','采购财务调整',NULL,'POST',811,'ACTIVE',1,0),
(5117112,0,'PLATFORM','BUTTON',5107100,'platform:overseas-business:purchase:estimate','采购预估运费核对',NULL,'POST',812,'ACTIVE',1,0),
(5117113,0,'PLATFORM','BUTTON',5107100,'platform:overseas-business:purchase:apply-label','采购逐箱贴单',NULL,'POST',813,'ACTIVE',1,0),
(5117114,0,'PLATFORM','BUTTON',5107100,'platform:overseas-business:purchase:ship-overseas','采购海外整批交寄',NULL,'POST',814,'ACTIVE',1,0),
(5117115,0,'PLATFORM','BUTTON',5107100,'platform:overseas-business:purchase:ship-customer','采购国内寄客户',NULL,'POST',815,'ACTIVE',1,0);
INSERT INTO iam_role_permission(tenant_id,role_id,permission_id,created_at)
SELECT 0,r.id,p.id,NOW(3) FROM iam_role r JOIN iam_permission p
ON p.tenant_id=0 AND p.app_code='PLATFORM' AND p.permission_code IN
('platform:overseas-business:purchase:buy','platform:overseas-business:purchase:cancel',
'platform:overseas-business:purchase:receive-overseas','platform:overseas-business:purchase:receive-domestic',
'platform:overseas-business:purchase:pack','platform:overseas-business:purchase:manage',
'platform:overseas-business:purchase:label','platform:overseas-business:purchase:charge','platform:overseas-business:purchase:finance-adjust',
'platform:overseas-business:purchase:estimate','platform:overseas-business:purchase:apply-label',
'platform:overseas-business:purchase:ship-overseas','platform:overseas-business:purchase:ship-customer')
WHERE r.tenant_id=0 AND r.app_code='PLATFORM' AND UPPER(r.role_code) IN('PLATFORM_ADMIN','PLATFORM_CUSTOM_ADMIN')
AND r.status='ACTIVE' AND r.deleted=0;
-- 自营业务菜单资源用于菜单管理;四个页面和所有只读接口统一由 list 授权,采集写权限独立。
USE baiyue_iam;
SET NAMES utf8mb4;
INSERT INTO iam_permission (id,tenant_id,app_code,permission_type,parent_id,permission_code,permission_name,route_path,http_method,sort_no,status,built_in,created_at,updated_at,deleted) VALUES
(5118100,0,'PLATFORM','MENU',0,'platform:self-operated:menu','自营业务',NULL,NULL,1100,'ACTIVE',1,CURRENT_TIMESTAMP(3),CURRENT_TIMESTAMP(3),0),
(5118140,0,'PLATFORM','MENU',5118100,'platform:self-operated:overview:menu','经营总览','/self-operated/overview','GET',5,'ACTIVE',1,CURRENT_TIMESTAMP(3),CURRENT_TIMESTAMP(3),0),
(5118110,0,'PLATFORM','MENU',5118100,'platform:self-operated:sales:menu','销量分析','/self-operated/sales','GET',10,'ACTIVE',1,CURRENT_TIMESTAMP(3),CURRENT_TIMESTAMP(3),0),
(5118120,0,'PLATFORM','MENU',5118100,'platform:self-operated:inventory:menu','库存分析','/self-operated/inventory','GET',20,'ACTIVE',1,CURRENT_TIMESTAMP(3),CURRENT_TIMESTAMP(3),0),
(5118130,0,'PLATFORM','MENU',5118100,'platform:self-operated:collection:menu','数据采集','/self-operated/collection','GET',30,'ACTIVE',1,CURRENT_TIMESTAMP(3),CURRENT_TIMESTAMP(3),0),
(5118000,0,'PLATFORM','API',5118100,'platform:self-operated-analytics:list','读取平台自营出库销量与库存分析','/api/platform/v1/last-leg/self-operated-analytics','GET',40,'ACTIVE',1,CURRENT_TIMESTAMP(3),CURRENT_TIMESTAMP(3),0),
(5118002,0,'PLATFORM','API',5118120,'platform:self-operated-analytics:export','导出平台自营库存周转','/api/platform/v1/files/export-tasks','POST',20,'ACTIVE',1,CURRENT_TIMESTAMP(3),CURRENT_TIMESTAMP(3),0),
(5118001,0,'PLATFORM','API',5118130,'platform:self-operated-analytics:sync','平台自营采集重试与重采集','/api/platform/v1/last-leg/self-operated-analytics/sync-tasks','POST',10,'ACTIVE',1,CURRENT_TIMESTAMP(3),CURRENT_TIMESTAMP(3),0);
INSERT INTO iam_role_permission (role_id,permission_id,tenant_id,created_at) VALUES
(4000001,5118000,0,CURRENT_TIMESTAMP(3)),
(4000001,5118001,0,CURRENT_TIMESTAMP(3)),
(4000001,5118002,0,CURRENT_TIMESTAMP(3)),
(4000001,5118100,0,CURRENT_TIMESTAMP(3)),
(4000001,5118140,0,CURRENT_TIMESTAMP(3)),
(4000001,5118110,0,CURRENT_TIMESTAMP(3)),
(4000001,5118120,0,CURRENT_TIMESTAMP(3)),
(4000001,5118130,0,CURRENT_TIMESTAMP(3));
-- Appointment work independent write permissions (current baseline).
USE baiyue_iam;
INSERT INTO iam_permission (id, tenant_id, app_code, permission_type, parent_id, permission_code, permission_name, route_path, http_method, sort_no, status, built_in, created_at, updated_at, deleted) VALUES (5107283,0,'PLATFORM','BUTTON',5107280,'platform:appointment:manage-work','维护预约工作安排',NULL,'POST',743,'ACTIVE',1,CURRENT_TIMESTAMP(3),CURRENT_TIMESTAMP(3),0);
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000001,5107283,0,CURRENT_TIMESTAMP(3));
INSERT INTO iam_permission (id, tenant_id, app_code, permission_type, parent_id, permission_code, permission_name, route_path, http_method, sort_no, status, built_in, created_at, updated_at, deleted) VALUES (5102213,0,'PLATFORM','BUTTON',5102200,'platform:firstleg:terminal-drayage:direct-unload:confirm','登记直送目的仓实际卸货',NULL,'POST',60,'ACTIVE',1,CURRENT_TIMESTAMP(3),CURRENT_TIMESTAMP(3),0);
INSERT INTO iam_role_permission (role_id, permission_id, tenant_id, created_at) VALUES (4000001,5102213,0,CURRENT_TIMESTAMP(3));
SELECT 'PASS' AS initialization_status, 'CN' AS region, 227 AS initialized_tables;
File diff suppressed because it is too large Load Diff
+2
View File
@@ -56,3 +56,5 @@
| PDF 标签、审计、跨区双向事件 | `print/`、`audit-service/`、`event-bridge-service/` | 事件模型先读 `common-event-contract/AGENTS.md`;国内真实生产验收 `firstleg/.../TaillegRealProducerAcceptanceTest.java`、海外真实消费验收 `lastleg-service/.../TaillegRealConsumerAcceptanceTest.java`;可靠投递与 CN/OVERSEAS 目标路由读 `event-bridge-service/AGENTS.md` |
散货托盘码与跨区传递:`firstleg/` 的 `LoadingPalletLabelService.java` 生成冻结标签并调用 Print 输出 PDF,`LoadingCompletedOutboxService.java` 传递装柜快照;`lastleg-service/` 通过 `LastlegSourcePalletMapper.java` 保存来源托盘,`InboundPlanService.java` 和 `ContainerInboundPlanConversionCoordinator.java` 消费。标签与资源预留的细节继续读对应服务指引。
平台自营销量、产品库存与采集:正式入口为 ../docs/自营业务/README.md;适配从 integration-service/AGENTS.md 进入,持久化、指标和平台运行查询从 lastleg-service/AGENTS.md 进入 selfoperated/analytics/,权限源为 iam/src/main/resources/db/selfoperated-analytics-permissions.sql。Admin 从 ../apps/admin-web/src/modules/self-operated/AGENTS.md 进入;与客户物流订单和仓储作业库存分开。
Binary file not shown.

After

Width:  |  Height:  |  Size: 236 KiB

+90
View File
@@ -0,0 +1,90 @@
<svg xmlns="http://www.w3.org/2000/svg" width="1800" height="1280" viewBox="0 0 1800 1280">
<defs>
<marker id="arrow" markerWidth="10" markerHeight="10" refX="9" refY="3" orient="auto"><path d="M0,0 L10,3 L0,6 Z" fill="#335c81"/></marker>
<marker id="greenArrow" markerWidth="10" markerHeight="10" refX="9" refY="3" orient="auto"><path d="M0,0 L10,3 L0,6 Z" fill="#18865b"/></marker>
<marker id="redArrow" markerWidth="10" markerHeight="10" refX="9" refY="3" orient="auto"><path d="M0,0 L10,3 L0,6 Z" fill="#c94d4d"/></marker>
<style>
.title{font:700 34px 'Microsoft YaHei','Noto Sans SC',sans-serif;fill:#17324d}
.sub{font:400 17px 'Microsoft YaHei','Noto Sans SC',sans-serif;fill:#547086}
.lane{font:700 20px 'Microsoft YaHei','Noto Sans SC',sans-serif;fill:#17324d}
.boxTitle{font:700 19px 'Microsoft YaHei','Noto Sans SC',sans-serif;fill:#17324d}
.boxText{font:400 16px 'Microsoft YaHei','Noto Sans SC',sans-serif;fill:#36566d}
.small{font:400 14px 'Microsoft YaHei','Noto Sans SC',sans-serif;fill:#547086}
.assert{font:500 16px 'Microsoft YaHei','Noto Sans SC',sans-serif;fill:#23445a}
.line{stroke:#335c81;stroke-width:3;fill:none;marker-end:url(#arrow)}
.gline{stroke:#18865b;stroke-width:3;fill:none;marker-end:url(#greenArrow)}
.rline{stroke:#c94d4d;stroke-width:3;fill:none;marker-end:url(#redArrow)}
</style>
</defs>
<rect width="1800" height="1280" fill="#f6f9fc"/>
<text x="70" y="62" class="title">海外业务|库存变动测试总流程图</text>
<text x="70" y="94" class="sub">测试看库存:先看库存状态,再看数量、位置、流水和幂等;灰色节点只改状态/资源,不直接改可用库存。</text>
<g transform="translate(70,125)">
<rect width="1660" height="58" rx="12" fill="#e9f1f8"/>
<circle cx="28" cy="29" r="10" fill="#18865b"/><text x="50" y="35" class="small">绿色:库存增加/恢复</text>
<circle cx="250" cy="29" r="10" fill="#c94d4d"/><text x="272" y="35" class="small">红色:库存扣减</text>
<circle cx="450" cy="29" r="10" fill="#e19a28"/><text x="472" y="35" class="small">橙色:冻结/释放</text>
<circle cx="690" cy="29" r="10" fill="#7657a8"/><text x="712" y="35" class="small">紫色:SKU/箱唛变化</text>
<circle cx="960" cy="29" r="10" fill="#78909c"/><text x="982" y="35" class="small">灰色:状态/资源变化</text>
<text x="1260" y="35" class="small">所有写操作:租户隔离 + 版本/锁 + 幂等键</text>
</g>
<g transform="translate(70,220)">
<rect width="1660" height="196" rx="16" fill="#edf5ee" stroke="#b7d9c2" stroke-width="2"/>
<text x="24" y="34" class="lane">A. 库存来源与入仓</text>
<rect x="24" y="58" width="240" height="96" rx="12" fill="#fff" stroke="#6ea984" stroke-width="2"/>
<text x="44" y="88" class="boxTitle">头程装柜完成事件</text><text x="44" y="116" class="boxText">生成尾程单 / 冻结明细</text><text x="44" y="140" class="small">在途:不可用库存</text>
<path d="M264 106 H330" class="line"/>
<rect x="330" y="58" width="250" height="96" rx="12" fill="#fff" stroke="#6ea984" stroke-width="2"/>
<text x="350" y="88" class="boxTitle">平台转换入仓计划</text><text x="350" y="116" class="boxText">按入仓单 / 推荐托数建计划</text><text x="350" y="140" class="small">仍未形成可用库存</text>
<path d="M580 106 H646" class="line"/>
<rect x="646" y="58" width="290" height="96" rx="12" fill="#fff" stroke="#18865b" stroke-width="3"/>
<text x="666" y="88" class="boxTitle">PDA 签收 → 实收 → 上架</text><text x="666" y="116" class="boxText">完成后入仓库存入账</text><text x="666" y="140" class="small">AVAILABLE + 位置 + 库存流水</text>
<path d="M936 106 H1002" class="gline"/>
<rect x="1002" y="58" width="280" height="96" rx="12" fill="#e6f6ed" stroke="#18865b" stroke-width="2"/>
<text x="1022" y="88" class="boxTitle">可用库存池</text><text x="1022" y="116" class="boxText">客户 × 海外仓 × 目的仓</text><text x="1022" y="140" class="small">入仓单汇总;托盘只做作业维度</text>
<rect x="1316" y="58" width="310" height="96" rx="12" fill="#f0f2f4" stroke="#9baab4" stroke-width="2"/>
<text x="1336" y="88" class="boxTitle">门禁与失败</text><text x="1336" y="116" class="boxText">照片、仓绑定、客户/柜号</text><text x="1336" y="140" class="small">任一失败:库存与状态整体回滚</text>
</g>
<g transform="translate(70,450)">
<rect width="1660" height="222" rx="16" fill="#fff8ec" stroke="#efd39a" stroke-width="2"/>
<text x="24" y="34" class="lane">B. 从可用库存出发的四类作业</text>
<rect x="24" y="60" width="360" height="126" rx="12" fill="#fff" stroke="#dfa43c" stroke-width="2"/>
<text x="44" y="88" class="boxTitle">排车 / 一件代发拣货</text><text x="44" y="116" class="boxText">AVAILABLE → 冻结 → PICKED</text><text x="44" y="144" class="boxText">发车/出库 → 扣减</text><text x="44" y="170" class="small">整托扫描也按入仓单组成核平</text>
<rect x="430" y="60" width="360" height="126" rx="12" fill="#fff" stroke="#7657a8" stroke-width="2"/>
<text x="450" y="88" class="boxTitle">换标</text><text x="450" y="116" class="boxText">冻结 hold_packages</text><text x="450" y="144" class="boxText">旧 SKU 转出 → 新 SKU 转入</text><text x="450" y="170" class="small">箱唛/托盘绑定变化,箱数守恒</text>
<rect x="836" y="60" width="360" height="126" rx="12" fill="#fff" stroke="#dfa43c" stroke-width="2"/>
<text x="856" y="88" class="boxTitle">仓储转运</text><text x="856" y="116" class="boxText">来源仓冻结/扣减</text><text x="856" y="144" class="boxText">目标仓收货 → 增加</text><text x="856" y="170" class="small">可联动换标;来源/目标核对</text>
<rect x="1242" y="60" width="384" height="126" rx="12" fill="#fff" stroke="#c94d4d" stroke-width="2"/>
<text x="1262" y="88" class="boxTitle">废弃</text><text x="1262" y="116" class="boxText">申请仅锁箱:DISCARD_PENDING</text><text x="1262" y="144" class="boxText">PDA 实际确认 → 扣减 → DISCARDED</text><text x="1262" y="170" class="small">驳回释放;平台结案不再扣一次</text>
</g>
<g transform="translate(70,706)">
<rect width="1660" height="222" rx="16" fill="#eef3fa" stroke="#b7cae2" stroke-width="2"/>
<text x="24" y="34" class="lane">C. 出库后的结果与恢复</text>
<rect x="24" y="60" width="350" height="126" rx="12" fill="#fff" stroke="#c94d4d" stroke-width="2"/>
<text x="44" y="88" class="boxTitle">OUTBOUNDED / 派送中</text><text x="44" y="116" class="boxText">库存已扣减,保留出库事实</text><text x="44" y="144" class="boxText">签收:不再二次扣库存</text><text x="44" y="170" class="small">派送费用与库存动作分开核对</text>
<path d="M374 123 H446" class="line"/>
<rect x="446" y="60" width="380" height="126" rx="12" fill="#fff" stroke="#18865b" stroke-width="3"/>
<text x="466" y="88" class="boxTitle">异常退回入仓</text><text x="466" y="116" class="boxText">只能选原出库拣货事实</text><text x="466" y="144" class="boxText">RETURN_STOCK_IN → 目标托盘/库位</text><text x="466" y="170" class="small">库存恢复 + 异常完成 + 派送 RETURNED</text>
<rect x="900" y="60" width="330" height="126" rx="12" fill="#fff" stroke="#78909c" stroke-width="2"/>
<text x="920" y="88" class="boxTitle">盘点调整</text><text x="920" y="116" class="boxText">实盘数量 − 账面数量 = 差异</text><text x="920" y="144" class="boxText">按正/负生成调整流水</text><text x="920" y="170" class="small">无差异不造流水;需 adjust 权限</text>
<rect x="1270" y="60" width="356" height="126" rx="12" fill="#fff" stroke="#78909c" stroke-width="2"/>
<text x="1290" y="88" class="boxTitle">移库 / 拆合托 / 换绑</text><text x="1290" y="116" class="boxText">同仓位置或托盘组成变化</text><text x="1290" y="144" class="boxText">数量净额 = 0</text><text x="1290" y="170" class="small">记录位置流水;资源锁防并发</text>
</g>
<path d="M1142 416 V450" class="gline"/><path d="M120 638 V706" class="rline"/><path d="M610 638 V706" class="gline"/>
<path d="M1020 638 V706" class="line"/><path d="M1435 638 V706" class="rline"/>
<g transform="translate(70,965)">
<rect width="1660" height="250" rx="16" fill="#ffffff" stroke="#d5e0e8" stroke-width="2"/>
<text x="24" y="36" class="lane">D. 测试统一断言(每个库存场景都要检查)</text>
<text x="42" y="78" class="assert">① 数量守恒:客户 / 海外仓 / 目的仓 / 入仓单 / 托盘组成逐层核平</text>
<text x="42" y="114" class="assert">② 三账一致:库存余额 = 位置明细汇总 = 库存流水结果</text>
<text x="42" y="150" class="assert">③ 幂等并发:重复事件、重复请求、并发锁定不得产生第二笔变动</text>
<text x="42" y="186" class="assert">④ 原子回滚:权限、门禁、资源锁、跨服务失败时,库存/单据/流水一起回滚</text>
<text x="42" y="222" class="assert">⑤ 隔离校验:客户、仓、来源入仓单、原出库事实不可伪造或串用</text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 9.2 KiB

@@ -0,0 +1,40 @@
# 海外业务库存变动测试整理
范围依据:`lastleg-service/AGENTS.md`、`docs/backend-business-index.md` 及当前海外仓库存、入仓、出库、换标、转运、废弃、异常退回和 PDA 作业入口。
## 先统一库存口径
- **可用库存**:按客户、海外仓、目的仓、入仓单汇总箱数;SKU、箱唛和托盘是明细快照/作业维度。
- **冻结库存**:拣货、换标、废弃、转运等处理中暂时不可重复使用;冻结不等于已经扣减。
- **库存流水**:每一次入账、冻结、释放、扣减、恢复、SKU 转换和位置变化都应能按业务单号、幂等键追溯。
- **托盘不是库存归属**:合托后一个物理托盘可以包含多个入仓单,出库、换标和退回必须按托盘组成明细核平。
## 测试场景矩阵
| 场景 | 触发与前置 | 库存变动 | 测试重点 |
|---|---|---|---|
| 头程接柜/海外入仓 | 装柜完成事件 → 生成尾程单/入仓计划;PDA 签收、实收、上架、完成 | 在途冻结 → 入仓后 `AVAILABLE` 增加;写库存位置和流水 | 柜号/客户/入仓单隔离;卸柜照片门禁;重复事件不重复入账;失败整事务回滚 |
| 普通排车出库/派送 | 计划已入仓;排车审核、拣货、箱数核平、发车 | `AVAILABLE` → 冻结/已拣;原子出库后可用库存扣减 | 整托/部分托按组成明细核平;未审核、数量不平、车辆门禁时不得出库;同键重放幂等 |
| 一件代发 | 已完成入库且有可用箱唛/SKU;创建 `WAIT_PICK` 出库单 | SKU/箱唛库存冻结 → PDA 拣货 → `OUTBOUNDED` 扣减 | 候选只能来自真实可用库存;一单不得跨客户/跨仓;整托扫描任一明细失败必须整体回滚 |
| 客户换标 | 历史入仓库存可用;客户申请、PDA 扫旧 SKU/箱唛、完工、客户确认 | 旧 SKU/箱唛冻结;换标完成后旧库存转出、新 SKU/箱唛转入;库存总箱数守恒 | 同箱多 SKU 不重复冻结;只移动本单 `hold_packages`;已生成出库单禁止再次拆托;照片/复核/客户确认门禁 |
| 仓储转运 | 来源库存可用;创建转运、测量、换标(可选)、出库、目标仓收货 | 来源仓冻结/扣减 → 目标仓入账;换标时 SKU 转换 | 来源客户、入仓单和箱数核对;部分转运数量守恒;目标仓与来源仓不能串;重复完成不重复入账 |
| 货物废弃 | 一件代发/库存货物申请废弃;审批后由绑定海外 PDA 实际确认 | `AVAILABLE` → `DISCARD_PENDING`;实际确认后 SKU、余额、位置扣减并记 `DISCARDED` | 申请阶段只锁箱不扣库存;驳回释放;批准不是实际扣减;实际数量与逐箱流水一致;失败整批回滚 |
| 异常退回入仓 | 只能选择原出库拣货事实;异常单受理并完成退回 | 原出库来源核验 → `RETURN_STOCK_IN` 恢复到真实目标托盘/库位 | 不能伪造出库来源、借用其他客户主单;退回数量与原实发核平;异常单完成与派送 `RETURNED` 同事务 |
| PDA 盘点调整 | 绑定海外仓;盘点锁定库存位置并提交实盘数量 | 按差异产生增加/减少调整流水;无差异不产生虚假变动 | 需要 `inventory:adjust`;并发版本校验;差异正负方向正确;盘点重复提交幂等 |
| PDA 移库/托盘拆合/换绑 | 同仓有效托盘/库位;资源锁成功 | 数量净额不变,仅位置/托盘组成变化,写位置流水 | 不跨仓;托盘组成明细保留;资源锁释放;出库/换标占用时禁止绕过协调单独移动 |
## 不应误判为库存变动
- 目的仓修改、暂扣/解除、报价、排车预排、外接预约、车辆/司机资料:只改变状态、资格、资源占用或费用快照。
- 海外采购样品履约:按当前契约走 Admin 台账,**不接入 PDA,也不写 WMS 可用库存**。
- 退货申请/废弃申请/转派送建单:申请或建单阶段只形成冻结/候选/出库单,必须到实际收货、实际扣减或实际出库节点才确认数量变化。
## 每条库存用例的统一断言
1. 变动前后按客户、海外仓、目的仓、入仓单、托盘组成核对数量守恒。
2. 查询余额、位置明细和库存流水三处结果一致,且业务单号/幂等键可追溯。
3. 重复请求、重复事件、并发操作不得新增第二笔库存变动。
4. 任一校验、权限、资源锁或跨服务依赖失败时,库存、单据状态和流水一起回滚。
5. 客户越权、跨仓、跨客户、伪造来源入仓单/出库单均应拒绝。
流程图:`overseas-inventory-mutation-flow.svg` / `overseas-inventory-mutation-flow.png`
+5
View File
@@ -1,5 +1,10 @@
# File Service 模块指引
## 数据库访问与中文注释约束
- 强制遵守根 `../AGENTS.md` 的“数据库访问与中文代码注释”全部规则:正常业务访问统一为 `Controller → Service → Repository → Mapper`,不得省略 Repository 或跨层直调;生产 SQL 由 Mapper 执行,Repository 不得直接使用 JdbcTemplate 或原生 JDBC。非 HTTP 入口从 Service 进入;无数据库模块不引入数据库访问。
- 每个手写方法及构造器须有简短中文说明;核心业务规则、复杂 SQL、事务、锁、幂等、并发及失败处理须补充适量中文注释,重点说明原因和边界。新增、修改方法立即执行,触及的存量代码同步整改。
## 职责与边界
- Mapper 只由 `FileServiceApplication.java` 对 `com.baiyue.file` 根包按 `@Mapper` 过滤扫描;新增或移动 Mapper 后从后端根运行 `node scripts/mapper-scan-contract.mjs`,不得增加子域扫描配置。
@@ -21,13 +21,14 @@ public class ExportProviderClient {
@Resource private WarehouseExportProviderClient warehouse;
@Resource private FirstlegExportProviderClient firstleg;
@Resource private FinanceExportProviderClient finance;
@Resource private LastlegExportProviderClient lastleg;
@Resource
private MeterRegistry meters;
@PostConstruct
void initializeClients() {
this.clients = Map.of("iam-service", iam, "order-service", order,
"warehouse-service", warehouse, "firstleg-service", firstleg,
"finance-service", finance);
"finance-service", finance, "lastleg-service", lastleg);
}
public ApiResponse<ExportBatchResponse> batch(String internalToken, String exportType,
@@ -0,0 +1,7 @@
package com.baiyue.file.client;
import org.springframework.cloud.openfeign.FeignClient;
@FeignClient(name="lastleg-service", contextId="lastlegExportProviderClient",
url="${baiyue.clients.lastleg.url:}", configuration=ExportProviderFeignConfiguration.class)
interface LastlegExportProviderClient extends ExportProviderFeignClient { }
@@ -11,7 +11,7 @@ import java.util.regex.Pattern;
@Component
@ConfigurationProperties(prefix = "baiyue.file.export")
public class ExportDefinitionRegistry {
private static final Set<String> SERVICES = Set.of("iam-service", "order-service", "warehouse-service", "firstleg-service", "finance-service");
private static final Set<String> SERVICES = Set.of("iam-service", "order-service", "warehouse-service", "firstleg-service", "finance-service", "lastleg-service");
private static final Pattern TYPE = Pattern.compile("[A-Z0-9_]+");
private static final Pattern PATH = Pattern.compile("/internal/exports/v1/([A-Z0-9_]+)/batches");
private static final Pattern PERMISSION = Pattern.compile("[a-z]+(?::[a-z-]+){2,}");
@@ -9,6 +9,8 @@ import java.util.Arrays;
enum BusinessFileCategory {
FLEET_DRIVER_LICENSE(false, FormatPolicy.PDF_IMAGE, Limits.STANDARD, BusinessIdPolicy.POSITIVE_LONG),
FLEET_TRIP_OPERATION_EVIDENCE(false, FormatPolicy.PDF_IMAGE, Limits.STANDARD, BusinessIdPolicy.POSITIVE_LONG),
OVERSEAS_DISPATCH_VEHICLE_EVIDENCE(false, FormatPolicy.PDF_IMAGE, Limits.STANDARD, BusinessIdPolicy.POSITIVE_LONG),
OVERSEAS_DISPATCH_DRIVER_EVIDENCE(false, FormatPolicy.PDF_IMAGE, Limits.STANDARD, BusinessIdPolicy.POSITIVE_LONG),
FLEET_VEHICLE_RECORD_PHOTO(false, FormatPolicy.IMAGE, Limits.STANDARD, BusinessIdPolicy.POSITIVE_LONG),
DELIVERY_LOADING_PHOTO(true, FormatPolicy.ARBITRARY, Limits.CUSTOMS, BusinessIdPolicy.POSITIVE_LONG),
DELIVERY_BOL(true, FormatPolicy.ARBITRARY, Limits.CUSTOMS, BusinessIdPolicy.POSITIVE_LONG),
@@ -22,11 +24,16 @@ enum BusinessFileCategory {
INBOUND_HOLD_EVIDENCE(true, FormatPolicy.STANDARD, Limits.STANDARD, BusinessIdPolicy.POSITIVE_LONG),
OVERSEAS_PROCUREMENT_RECEIPT(true, FormatPolicy.STANDARD, Limits.STANDARD, BusinessIdPolicy.POSITIVE_LONG),
OVERSEAS_PROCUREMENT_VOUCHER(true, FormatPolicy.STANDARD, Limits.STANDARD, BusinessIdPolicy.POSITIVE_LONG),
OVERSEAS_PROCUREMENT_LABEL(true, FormatPolicy.PDF_IMAGE, Limits.STANDARD, BusinessIdPolicy.POSITIVE_LONG),
OVERSEAS_PROCUREMENT_PURCHASE(true, FormatPolicy.PDF_IMAGE, Limits.STANDARD, BusinessIdPolicy.POSITIVE_LONG),
OVERSEAS_PROCUREMENT_BUDGET(true, FormatPolicy.PDF_IMAGE, Limits.STANDARD, BusinessIdPolicy.POSITIVE_LONG),
OVERSEAS_PROCUREMENT_EXCEPTION(true, FormatPolicy.PDF_IMAGE, Limits.STANDARD, BusinessIdPolicy.POSITIVE_LONG),
CONTAINER_CLEARANCE_DOCUMENT(false, FormatPolicy.STANDARD, Limits.STANDARD, BusinessIdPolicy.POSITIVE_LONG),
LOADING_CUSTOMS_DECLARATION(false, FormatPolicy.STANDARD, Limits.STANDARD, BusinessIdPolicy.POSITIVE_LONG),
CONTAINER_DELIVERY_ORDER(false, FormatPolicy.STANDARD, Limits.STANDARD, BusinessIdPolicy.POSITIVE_LONG),
CONTAINER_PICKUP_ORDER(false, FormatPolicy.STANDARD, Limits.STANDARD, BusinessIdPolicy.POSITIVE_LONG),
OVERSEAS_UNLOAD_PHOTO(false, FormatPolicy.STANDARD, Limits.STANDARD, BusinessIdPolicy.POSITIVE_LONG),
OVERSEAS_CARGO_DISCARD_PHOTO(true, FormatPolicy.IMAGE, Limits.STANDARD, BusinessIdPolicy.POSITIVE_LONG),
OVERSEAS_RELABEL_PHOTO(true, FormatPolicy.STANDARD, Limits.STANDARD, BusinessIdPolicy.POSITIVE_LONG),
OVERSEAS_TRANSFER_MEASUREMENT_PHOTO(true, FormatPolicy.STANDARD, Limits.STANDARD, BusinessIdPolicy.POSITIVE_LONG),
OVERSEAS_RELABEL_TOTAL_DOCUMENT(true, FormatPolicy.PDF, Limits.STANDARD, BusinessIdPolicy.POSITIVE_LONG),
@@ -62,7 +69,12 @@ enum BusinessFileCategory {
.orElseThrow(() -> new BizException(ResultCode.BAD_REQUEST, "不支持的附件业务类型"));
}
/** 校验文件归属;跨客户排车证据固定为平台所有,不随货物客户变化。 */
void validateOwner(long tenantId) {
if ((this == OVERSEAS_DISPATCH_VEHICLE_EVIDENCE || this == OVERSEAS_DISPATCH_DRIVER_EVIDENCE)
&& tenantId != 0) {
throw new BizException(ResultCode.BAD_REQUEST, "排车车辆及司机证据必须归属平台");
}
if (this == FLEET_TRIP_OPERATION_EVIDENCE && tenantId != 0) {
throw new BizException(ResultCode.BAD_REQUEST, "出车实测凭证必须归属平台");
}
@@ -21,9 +21,11 @@ import java.time.LocalDateTime;
import java.util.Locale;
import java.util.Map;
import java.util.TreeMap;
import java.util.Set;
@Service
public class ExportTaskService {
private static final String TURNOVER = "SELFOP_INVENTORY_TURNOVER";
@Resource private ExportTaskRepository repository;
@Resource private ExportStorage storage;
@Resource private ObjectMapper objectMapper;
@@ -34,6 +36,7 @@ public class ExportTaskService {
public ExportTaskResponse create(AuthenticatedUser user, CreateExportTaskRequest request) {
requirePlatform(user);
String type = request.exportType().trim().toUpperCase(Locale.ROOT);
if (TURNOVER.equals(type) && user.impersonated()) throw new BizException(ResultCode.FORBIDDEN, "平台自营导出不支持代登录");
String format = request.format().trim().toUpperCase(Locale.ROOT);
var definition = registry.require(type);
if (!"XLSX".equals(format)) throw new BizException(ResultCode.VALIDATION_FAILED, "当前仅支持 XLSX 格式");
@@ -46,7 +49,11 @@ public class ExportTaskService {
}
validateParameters(type, request.parameters());
validateTypeParameters(type, request.parameters());
String parametersJson = parametersJson(request.parameters());
Map<String, Object> parameters = new TreeMap<>(request.parameters() == null ? Map.of() : request.parameters());
if ("TRIP_OPERATIONS_LIST".equals(type)) {
parameters.put("costVisible", user.permissions().contains("platform:fleet:trip:list"));
}
String parametersJson = parametersJson(parameters);
long id = IdWorker.getId();
LocalDateTime now = LocalDateTime.now();
FileExportTask task = new FileExportTask();
@@ -92,6 +99,7 @@ public class ExportTaskService {
public DownloadResource download(AuthenticatedUser user, long id) {
FileExportTask task = ownedTask(user, id);
requireExportCostAccess(user, task);
if (!"SUCCEEDED".equals(task.getStatus())) {
throw new BizException(ResultCode.CONFLICT, "导出任务尚未完成或文件已过期");
}
@@ -103,6 +111,7 @@ public class ExportTaskService {
public ExportTaskResponse retry(AuthenticatedUser user, long id) {
FileExportTask task = ownedTask(user, id);
requireExportCostAccess(user, task);
var definition = registry.require(task.getExportType());
if (!definition.isEnabled()) throw new BizException(ResultCode.CONFLICT, "该导出类型已停用");
String permission = definition.getRequiredPermission();
@@ -128,6 +137,21 @@ public class ExportTaskService {
return response(repository.find(id));
}
private void requireExportCostAccess(AuthenticatedUser user, FileExportTask task) {
if (TURNOVER.equals(task.getExportType()) && (user.impersonated() || !user.permissions().contains("platform:self-operated-analytics:export"))) {
throw new BizException(ResultCode.FORBIDDEN, "缺少平台自营导出权限");
}
if (!"TRIP_OPERATIONS_LIST".equals(task.getExportType())) return;
try {
if (objectMapper.readTree(task.getParametersJson()).path("costVisible").asBoolean(false)
&& !user.permissions().contains("platform:fleet:trip:list")) {
throw new BizException(ResultCode.FORBIDDEN, "缺少出车成本读取权限,请重新创建不含成本的导出任务");
}
} catch (JsonProcessingException exception) {
throw new BizException(ResultCode.CONFLICT, "导出筛选快照无效,请重新创建任务");
}
}
private FileExportTask ownedTask(AuthenticatedUser user, long id) {
requirePlatform(user);
FileExportTask task = repository.find(id);
@@ -154,11 +178,14 @@ public class ExportTaskService {
}
values.forEach((key, value) -> {
if (key == null || key.isBlank() || key.length() > 64) throw new BizException(ResultCode.VALIDATION_FAILED, "导出筛选键无效");
validateParameterValue(value, 1);
if (TURNOVER.equals(type) && "snapshotContext".equals(key)) {
if (!(value instanceof String text) || text.isBlank() || text.length() > 16000)
throw new BizException(ResultCode.VALIDATION_FAILED, "库存周转查询版本无效,请刷新后重新导出");
} else validateParameterValue(value, 1);
});
try {
int maxBytes = ExportSchemaContracts.DOMESTIC_WAREHOUSE_ORDER_LIST.equals(type)
? 512 * 1024 : 4096;
? 512 * 1024 : TURNOVER.equals(type) ? 64 * 1024 : 4096;
if (objectMapper.writeValueAsBytes(values).length > maxBytes) {
throw new BizException(ResultCode.VALIDATION_FAILED,
"导出筛选条件不能超过 " + (maxBytes / 1024) + "KB");
@@ -192,6 +219,22 @@ public class ExportTaskService {
}
private void validateTypeParameters(String type, Map<String, Object> parameters) {
if (TURNOVER.equals(type)) {
Map<String,Object> values=parameters==null?Map.of():parameters;
if (!values.keySet().containsAll(Set.of("sourceAccount","warehouseCode","endDate","baseWindowDays","snapshotContext","columns","expectedTotal"))
|| !Set.of("sourceAccount","warehouseCode","endDate","baseWindowDays","groupBy","customerCodes","sku","focus","coverageDaysThreshold","turnoverStatus","sortBy","hideZeroInventory","snapshotContext","columns","expectedTotal").containsAll(values.keySet()))
throw new BizException(ResultCode.VALIDATION_FAILED, "库存周转导出筛选无效");
if (!(values.get("columns") instanceof java.util.List<?> columns) || columns.isEmpty() || columns.size()>30
|| columns.stream().anyMatch(v -> !(v instanceof String)) || new java.util.HashSet<>(columns).size()!=columns.size())
throw new BizException(ResultCode.VALIDATION_FAILED, "库存周转导出列无效");
if (values.containsKey("customerCodes") && (!(values.get("customerCodes") instanceof java.util.List<?> owners) || owners.size()>100 || owners.stream().anyMatch(v -> !(v instanceof String))))
throw new BizException(ResultCode.VALIDATION_FAILED, "库存周转货主范围无效");
try {
long count=new java.math.BigDecimal(String.valueOf(values.get("expectedTotal"))).longValueExact();
if(count<0 || count>200000) throw new ArithmeticException();
} catch(RuntimeException e) { throw new BizException(ResultCode.VALIDATION_FAILED, "库存周转导出条数无效"); }
return;
}
if (!ExportSchemaContracts.BUY_DECLARATION_ITEMS.equals(type)) return;
Map<String, Object> values = parameters == null ? Map.of() : parameters;
if (!values.keySet().equals(java.util.Set.of("loadingPlanId"))) {
+84
View File
@@ -35,6 +35,9 @@ spring:
firstlegExportProviderClient:
connect-timeout: 3000
read-timeout: 15000
lastlegExportProviderClient:
connect-timeout: 3000
read-timeout: 15000
financeExportProviderClient:
connect-timeout: 3000
read-timeout: 15000
@@ -203,4 +206,85 @@ baiyue:
max-rows: 200000
max-attempts: 3
batch-size: 500
LAST_MILE_ORDER_LIST:
provider-service: lastleg-service
provider-path: /internal/exports/v1/LAST_MILE_ORDER_LIST/batches
required-permission: platform:overseas-warehouse:last-mile-order:export
app-scope: PLATFORM
enabled: true
max-rows: 200000
max-attempts: 3
batch-size: 200
OVERSEAS_INVENTORY_BALANCE:
provider-service: lastleg-service
provider-path: /internal/exports/v1/OVERSEAS_INVENTORY_BALANCE/batches
required-permission: platform:overseas-warehouse:inventory:export
app-scope: PLATFORM
enabled: true
max-rows: 200000
max-attempts: 3
batch-size: 200
SELFOP_INVENTORY_TURNOVER:
provider-service: lastleg-service
provider-path: /internal/exports/v1/SELFOP_INVENTORY_TURNOVER/batches
required-permission: platform:self-operated-analytics:export
app-scope: PLATFORM
enabled: true
max-rows: 200000
max-attempts: 3
batch-size: 100
OVERSEAS_INVENTORY_LEDGER:
provider-service: lastleg-service
provider-path: /internal/exports/v1/OVERSEAS_INVENTORY_LEDGER/batches
required-permission: platform:overseas-warehouse:inventory:export
app-scope: PLATFORM
enabled: true
max-rows: 200000
max-attempts: 3
batch-size: 200
OVERSEAS_QUOTE_LIST:
provider-service: lastleg-service
provider-path: /internal/exports/v1/OVERSEAS_QUOTE_LIST/batches
required-permission: platform:overseas-master-data:quote:export
app-scope: PLATFORM
enabled: true
max-rows: 200000
max-attempts: 3
batch-size: 200
MONTHLY_EXCHANGE_RATE_LIST:
provider-service: lastleg-service
provider-path: /internal/exports/v1/MONTHLY_EXCHANGE_RATE_LIST/batches
required-permission: platform:overseas-master-data:exchange-rate:export
app-scope: PLATFORM
enabled: true
max-rows: 200000
max-attempts: 3
batch-size: 200
VEHICLE_LIST:
provider-service: lastleg-service
provider-path: /internal/exports/v1/VEHICLE_LIST/batches
required-permission: platform:overseas-master-data:vehicle:export
app-scope: PLATFORM
enabled: true
max-rows: 200000
max-attempts: 3
batch-size: 200
FLEET_QUOTE_LIST:
provider-service: lastleg-service
provider-path: /internal/exports/v1/FLEET_QUOTE_LIST/batches
required-permission: platform:fleet:quote:export
app-scope: PLATFORM
enabled: true
max-rows: 200000
max-attempts: 3
batch-size: 200
TRIP_OPERATIONS_LIST:
provider-service: lastleg-service
provider-path: /internal/exports/v1/TRIP_OPERATIONS_LIST/batches
required-permission: platform:fleet:operations:export
app-scope: PLATFORM
enabled: true
max-rows: 200000
max-attempts: 3
batch-size: 200
management.endpoints.web.exposure.include: health,info,prometheus
@@ -0,0 +1,12 @@
openapi: 3.0.3
info:
title: Cargo discard photo storage ownership contract
version: 1.0.0
description: >-
Uses the existing internal business-file upload, metadata and content endpoints, protected
by X-Internal-Service-Token. businessType is OVERSEAS_CARGO_DISCARD_PHOTO; tenantId is a
positive customer ID and businessId is the positive cargo discard application ID.
File enforces composite ownership and non-empty JPG/PNG bytes with image signature and
10 MiB limit. Lastleg owns the pallet binding, submitted visibility and immutable confirmation.
No anonymous or public file endpoint is introduced.
paths: {}
@@ -0,0 +1,167 @@
openapi: 3.0.3
info:
title: 平台排车车辆与司机证据内部文件契约
version: 1.0.0
description: >-
复用 InternalBusinessFileController 的现有通用内部入口,不新增公开文件路由。
两类证据均固定平台 tenantId=0,businessId 为排车内部正数 Long ID 的十进制表示,
不使用车辆 ID、司机 ID、车牌或客户 ID。车辆与司机证据分别使用
OVERSEAS_DISPATCH_VEHICLE_EVIDENCE、OVERSEAS_DISPATCH_DRIVER_EVIDENCE,不可互换。
File 校验内部服务令牌、平台归属、正数业务 ID、文件非空、最大 10MiB(10485760 字节,包含边界)、
PDF/JPG/PNG MIME 及对应内容签名。元数据和下载按 tenantId、businessType、businessId、fileId
联合查询 ACTIVE 且未删除文件,错车或错类别均视为归属不匹配,下载前完成归属校验。
上传生成不可变文件和真实元数据,不自动绑定证据或通过审核,不返回公开 URL 或存储路径。
Lastleg 负责排车存在性、仓库与角色权限、当前及历史附件引用和审核状态;File 不查询 Lastleg 业务表。
本文只描述排车网关实际消费的上传、元数据和内容三个操作,不改变通用文件接口的其他用途。
统一异常处理使用 HTTP 200 JSON 业务错误,调用方必须检查 code;内容接口错误也返回 JSON,不能当作文件。
security:
- InternalServiceToken: []
paths:
/internal/file/v1/business-files/{tenantId}/{businessType}/{businessId}:
parameters:
- {$ref: '#/components/parameters/TenantId'}
- {$ref: '#/components/parameters/BusinessType'}
- {$ref: '#/components/parameters/BusinessId'}
post:
operationId: uploadDispatchEvidence
summary: 上传本排车的车辆或司机证据
parameters:
- name: X-Operator-Id
in: header
required: true
description: Lastleg 已认证操作者的正数 Long ID
schema: {$ref: '#/components/schemas/PositiveLongString'}
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
required: [file]
properties:
file:
type: string
format: binary
description: 非空且不超过10485760字节;application/pdf、image/jpeg或image/png,并校验对应内容签名
responses:
'200': {$ref: '#/components/responses/MetadataOrError'}
/internal/file/v1/business-files/{tenantId}/{businessType}/{businessId}/{fileId}:
parameters:
- {$ref: '#/components/parameters/TenantId'}
- {$ref: '#/components/parameters/BusinessType'}
- {$ref: '#/components/parameters/BusinessId'}
- {$ref: '#/components/parameters/FileId'}
get:
operationId: readDispatchEvidenceMetadata
summary: 按本排车与证据类别联合校验并读取元数据
responses:
'200': {$ref: '#/components/responses/MetadataOrError'}
/internal/file/v1/business-files/{tenantId}/{businessType}/{businessId}/{fileId}/content:
parameters:
- {$ref: '#/components/parameters/TenantId'}
- {$ref: '#/components/parameters/BusinessType'}
- {$ref: '#/components/parameters/BusinessId'}
- {$ref: '#/components/parameters/FileId'}
get:
operationId: downloadDispatchEvidence
summary: 按完整复合归属读取文件内容
responses:
'200':
description: >-
成功返回真实文件;错误返回 application/json 统一业务错误。
A0400 表示作用域、ID或文件格式无效,A0403 表示内部令牌无效,
A0404 表示文件不存在、非有效文件或复合归属不匹配。
headers:
Cache-Control: {schema: {type: string, enum: [no-store]}}
Content-Disposition: {schema: {type: string}, description: 成功时为attachment及UTF-8文件名}
Content-Length: {schema: {type: integer, format: int64}, description: 成功时为真实文件字节数}
content:
application/pdf: {schema: {type: string, format: binary}}
image/jpeg: {schema: {type: string, format: binary}}
image/png: {schema: {type: string, format: binary}}
application/json: {schema: {$ref: '#/components/schemas/ErrorEnvelope'}}
components:
securitySchemes:
InternalServiceToken: {type: apiKey, in: header, name: X-Internal-Service-Token}
parameters:
TenantId:
name: tenantId
in: path
required: true
description: 两类排车证据只属于平台,客户作用域一律拒绝
schema: {type: string, enum: ['0']}
BusinessType:
name: businessType
in: path
required: true
schema: {$ref: '#/components/schemas/DispatchEvidenceType'}
BusinessId:
name: businessId
in: path
required: true
description: 排车内部正数Long ID,上限9223372036854775807;Lastleg以标准十进制字符串传入
schema: {$ref: '#/components/schemas/PositiveLongString'}
FileId:
name: fileId
in: path
required: true
schema: {$ref: '#/components/schemas/PositiveLongString'}
responses:
MetadataOrError:
description: >-
统一JSON响应,业务成功code为200。A0400为无效平台作用域、ID、操作者或文件;
A0403为内部服务令牌无效;A0404为文件不存在、非ACTIVE、已删除或复合归属不匹配;
S0503为存储不可用,S0500为元数据保存失败等内部异常。
content:
application/json:
schema:
oneOf:
- {$ref: '#/components/schemas/MetadataEnvelope'}
- {$ref: '#/components/schemas/ErrorEnvelope'}
schemas:
PositiveLongString:
type: string
pattern: '^[1-9][0-9]*$'
maxLength: 19
description: 正数Long的十进制字符串,值不得超过9223372036854775807
DispatchEvidenceType:
type: string
enum: [OVERSEAS_DISPATCH_VEHICLE_EVIDENCE, OVERSEAS_DISPATCH_DRIVER_EVIDENCE]
MetadataEnvelope:
type: object
required: [code, data]
properties:
code: {type: string, enum: ['200']}
message: {type: string}
data: {$ref: '#/components/schemas/Metadata'}
requestId: {type: string, nullable: true}
traceId: {type: string, nullable: true}
timestamp: {type: string, format: date-time}
Metadata:
type: object
required: [fileId, ownerScope, tenantId, businessType, businessId, fileName, sha256, contentType, sizeBytes, createdAt]
properties:
fileId: {$ref: '#/components/schemas/PositiveLongString'}
ownerScope: {type: string, enum: [PLATFORM]}
tenantId: {type: string, enum: ['0']}
businessType: {$ref: '#/components/schemas/DispatchEvidenceType'}
businessId: {$ref: '#/components/schemas/PositiveLongString'}
fileName: {type: string, minLength: 1, description: 清理路径和控制字符后的原始文件名}
sha256: {type: string, pattern: '^[0-9a-f]{64}$'}
contentType: {type: string, enum: [application/pdf, image/jpeg, image/png]}
sizeBytes:
type: string
pattern: '^[1-9][0-9]*$'
description: 实际字节数,范围1到10485760;公共Jackson配置将Long输出为字符串
example: '1024'
createdAt: {type: string, description: File真实上传时间,LocalDateTime的ISO本地时间表示,无时区偏移}
ErrorEnvelope:
type: object
required: [code, data]
properties:
code: {type: string, enum: [A0400, A0403, A0404, A0422, S0500, S0503]}
message: {type: string}
data: {type: object, nullable: true, description: 业务错误为null;参数校验错误可携带字段信息}
requestId: {type: string, nullable: true}
traceId: {type: string, nullable: true}
timestamp: {type: string, format: date-time}
@@ -0,0 +1,50 @@
openapi: 3.0.3
info:
title: 库存周转后台导出
version: 1.0.0
description: File 下载中心生成 XLSX,Lastleg 内部 Provider 按固定库存周转版本供数。浏览器不分页取数、不生成文件。
paths:
/api/platform/v1/files/export-tasks:
post:
summary: 提交库存周转 Excel 导出
description: |
仅平台、非代登录身份及 platform:self-operated-analytics:export 权限。
保留列表的 sourceAccount、warehouseCode、endDate、baseWindowDays、groupBy、customerCodes、sku、focus、coverageDaysThreshold、turnoverStatus、sortBy、hideZeroInventory、snapshotContext。
columns 为当前显示列的有序白名单键,服务端决定列名、格式并追加周转率证据列;expectedTotal 为已查询总条数,范围0至200000。
不接受 current/size/includeOverview。snapshotContext 最长16000字符,整组参数最大64KiB。空结果生成只有表头的文件。
后台每批最多100条,沿用固定上下文30分钟有效期;过期、服务重启或历史版本失效须刷新列表重新提交,不自动改用新版本。
版本或条数变化、分页缺失、超行数、生成失败时不提供部分文件。下载中心复用进度、临时失败退避重试、归属校验及过期规则。
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [exportType, format, taskName, parameters]
properties:
exportType: {type: string, enum: [SELFOP_INVENTORY_TURNOVER]}
format: {type: string, enum: [XLSX]}
taskName: {type: string, maxLength: 128}
parameters:
type: object
required: [sourceAccount, warehouseCode, endDate, baseWindowDays, snapshotContext, columns, expectedTotal]
properties:
snapshotContext: {type: string, minLength: 1, maxLength: 16000}
columns: {type: array, minItems: 1, maxItems: 30, uniqueItems: true, items: {type: string}}
expectedTotal: {type: integer, minimum: 0, maximum: 200000}
additionalProperties: true
responses:
'200': {description: ApiResponse 包装下载中心任务;业务错误遵循通用 code 契约}
'403': {description: 无平台自营导出权限或非平台身份}
/api/platform/v1/files/export-tasks/{taskId}/download:
get:
summary: 下载后台生成的库存周转 Excel
description: 校验任务归属、完成状态、有效期,以及当前非代登录身份和平台自营导出权限。
parameters:
- {name: taskId, in: path, required: true, schema: {type: string}}
responses:
'200':
description: XLSX 文件
content:
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet:
schema: {type: string, format: binary}
@@ -25,6 +25,7 @@ class ExportProviderClientTest {
@MockBean private WarehouseExportProviderClient warehouse;
@MockBean private FirstlegExportProviderClient firstleg;
@MockBean private FinanceExportProviderClient finance;
@MockBean private LastlegExportProviderClient lastleg;
@Resource private ExportProviderClient client;
@Configuration(proxyBeanMethods = false)
@@ -48,6 +49,16 @@ class ExportProviderClientTest {
verifyNoInteractions(iam,warehouse,firstleg,finance);
}
@Test void routesLastlegExportsThroughTheBoundedInternalClient() {
var response=ApiResponse.success(new ExportBatchResponse(1,"hash","snapshot",java.util.List.of(),java.util.List.of(),null,false,0L));
when(lastleg.batch(anyString(),anyString(),any())).thenReturn(response);
var definition=new ExportDefinitionRegistry.Definition();definition.setProviderService("lastleg-service");
var request=new ExportBatchRequest("9","0","PLATFORM","7",1,Map.of(),null,null,200);
assertSame(response,client.batch("token","LAST_MILE_ORDER_LIST",definition,request));
verify(lastleg).batch("token","LAST_MILE_ORDER_LIST",request);
verifyNoInteractions(iam,order,warehouse,firstleg,finance);
}
@Test void routesFinanceExportsToFinanceService() {
var response=ApiResponse.success(new ExportBatchResponse(1,"hash","snapshot",java.util.List.of(),java.util.List.of(),null,false,0L));
when(finance.batch(anyString(),anyString(),any())).thenReturn(response);
@@ -0,0 +1,49 @@
package com.baiyue.file.config;
import org.junit.jupiter.api.Test;
import org.yaml.snakeyaml.Yaml;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Map;
import static org.junit.jupiter.api.Assertions.*;
class LastlegExportDefinitionContractTest {
@Test void localAndNacosDefinitionsKeepTheSameBoundedProviderAndPermissions() throws Exception {
Map<?, ?> local = definitions(Path.of("src/main/resources/application.yml"));
Map<?, ?> nacos = definitions(Path.of("../config/nacos/test/file-service.yml"));
Map<String, String> expected = Map.ofEntries(
Map.entry("LAST_MILE_ORDER_LIST", "platform:overseas-warehouse:last-mile-order:export"),
Map.entry("SELFOP_INVENTORY_TURNOVER", "platform:self-operated-analytics:export"),
Map.entry("OVERSEAS_INVENTORY_BALANCE", "platform:overseas-warehouse:inventory:export"),
Map.entry("OVERSEAS_INVENTORY_LEDGER", "platform:overseas-warehouse:inventory:export"),
Map.entry("OVERSEAS_QUOTE_LIST", "platform:overseas-master-data:quote:export"),
Map.entry("MONTHLY_EXCHANGE_RATE_LIST", "platform:overseas-master-data:exchange-rate:export"),
Map.entry("VEHICLE_LIST", "platform:overseas-master-data:vehicle:export"),
Map.entry("FLEET_QUOTE_LIST", "platform:fleet:quote:export"),
Map.entry("TRIP_OPERATIONS_LIST", "platform:fleet:operations:export"));
for (var entry : expected.entrySet()) {
var definition = (Map<?, ?>) local.get(entry.getKey());
assertNotNull(definition, entry.getKey());
assertEquals(definition, nacos.get(entry.getKey()));
assertEquals("lastleg-service", definition.get("provider-service"));
assertEquals("/internal/exports/v1/" + entry.getKey() + "/batches", definition.get("provider-path"));
assertEquals(entry.getValue(), definition.get("required-permission"));
assertEquals("PLATFORM", definition.get("app-scope"));
assertEquals(entry.getKey().equals("SELFOP_INVENTORY_TURNOVER") ? 100 : 200, definition.get("batch-size"));
var controlled = new ExportDefinitionRegistry.Definition();
controlled.setProviderService("lastleg-service");
controlled.setProviderPath(String.valueOf(definition.get("provider-path")));
controlled.setRequiredPermission(entry.getValue());
controlled.setAppScope("PLATFORM");
var registry = new ExportDefinitionRegistry();
assertDoesNotThrow(() -> registry.setDefinitions(Map.of(entry.getKey(), controlled)));
}
}
private Map<?, ?> definitions(Path path) throws Exception {
Object value = new Yaml().load(Files.readString(path));
for (String key : new String[]{"baiyue", "file", "export", "definitions"}) value = ((Map<?, ?>) value).get(key);
return (Map<?, ?>) value;
}
}
@@ -0,0 +1,25 @@
package com.baiyue.file.service;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.test.util.ReflectionTestUtils;
import java.nio.file.Path;
import static org.assertj.core.api.Assertions.*;
class CargoDiscardPhotoStorageTest {
@TempDir Path root;
@Test void discardEvidenceIsCustomerOwnedAndRequiresRealImageSignature() throws Exception {
var category = BusinessFileCategory.require("OVERSEAS_CARGO_DISCARD_PHOTO");
category.validateOwner(7);
assertThatThrownBy(() -> category.validateOwner(0)).isInstanceOf(com.baiyue.common.core.exception.BizException.class);
assertThatThrownBy(() -> category.storageBusinessId("0")).isInstanceOf(com.baiyue.common.core.exception.BizException.class);
var storage = new BusinessFileStorage(); ReflectionTestUtils.setField(storage, "configuredRoot", root); storage.initializeRoot();
byte[] bytes = {(byte)0x89, 0x50, 0x4e, 0x47, 13, 10, 26, 10};
var result = storage.store(7, "11", new MockMultipartFile("file", "discard.png", "image/png", bytes), category);
assertThat(storage.read(result.objectKey())).isEqualTo(bytes);
assertThatThrownBy(() -> storage.store(7, "11", new MockMultipartFile("file", "fake.png", "image/png", "fake".getBytes()), category)).hasMessageContaining("不是有效图片");
assertThatThrownBy(() -> storage.store(7, "11", new MockMultipartFile("file", "doc.pdf", "application/pdf", "%PDF-test".getBytes()), category)).hasMessageContaining("仅支持JPG");
assertThatThrownBy(() -> storage.store(7, "11", new MockMultipartFile("file", "large.png", "image/png", new byte[10*1024*1024+1]), category)).isInstanceOf(com.baiyue.common.core.exception.BizException.class);
}
}
@@ -0,0 +1,245 @@
package com.baiyue.file.service;
import com.baomidou.mybatisplus.core.MybatisConfiguration;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.TableInfoHelper;
import com.baiyue.common.core.exception.BizException;
import com.baiyue.file.controller.InternalBusinessFileController;
import com.baiyue.file.entity.FileObjectEntity;
import com.baiyue.file.mapper.FileObjectMapper;
import org.apache.ibatis.builder.MapperBuilderAssistant;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.io.TempDir;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.test.util.ReflectionTestUtils;
import org.springframework.web.multipart.MultipartFile;
import java.io.ByteArrayOutputStream;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Arrays;
import java.util.concurrent.atomic.AtomicLong;
import java.util.regex.Pattern;
import static org.assertj.core.api.Assertions.*;
import static org.mockito.ArgumentMatchers.*;
import static org.mockito.Mockito.*;
class DispatchEvidenceFileTest {
private static final String VEHICLE = "OVERSEAS_DISPATCH_VEHICLE_EVIDENCE";
private static final String DRIVER = "OVERSEAS_DISPATCH_DRIVER_EVIDENCE";
private static final int MAX_BYTES = 10 * 1024 * 1024;
@TempDir Path root;
/** 初始化真实 Lambda 查询列映射,使测试能逐列核对复合归属条件。 */
@BeforeAll static void metadata() {
TableInfoHelper.initTableInfo(new MapperBuilderAssistant(new MybatisConfiguration(), "dispatch-evidence"),
FileObjectEntity.class);
}
/** 两类证据只接受平台与有效排车内部 ID,非法输入不得访问数据库或磁盘。 */
@ParameterizedTest
@ValueSource(strings = {VEHICLE, DRIVER})
void requiresPlatformAndPositiveDispatchIdBeforeAccess(String type) {
var files = mock(FileObjectMapper.class);
var storage = mock(BusinessFileStorage.class);
var service = service(files, storage);
var upload = pdf();
for (long customer : new long[]{-1, 1, 900}) {
assertThatThrownBy(() -> service.upload(customer, type, "71", 7, upload)).isInstanceOf(BizException.class);
assertThatThrownBy(() -> service.metadata(customer, type, "71", 501)).isInstanceOf(BizException.class);
assertThatThrownBy(() -> service.download(customer, type, "71", 501)).isInstanceOf(BizException.class);
}
for (String id : new String[]{"0", "-1", "DISPATCH-71", "../71", "9223372036854775808"}) {
assertThatThrownBy(() -> service.upload(0, type, id, 7, upload)).isInstanceOf(BizException.class);
assertThatThrownBy(() -> service.metadata(0, type, id, 501)).isInstanceOf(BizException.class);
assertThatThrownBy(() -> service.download(0, type, id, 501)).isInstanceOf(BizException.class);
}
assertThatThrownBy(() -> service.upload(0, type, "71", 0, upload)).isInstanceOf(BizException.class);
assertThatThrownBy(() -> service.metadata(0, type, "71", 0)).isInstanceOf(BizException.class);
assertThatThrownBy(() -> service.download(0, type, "71", 0)).isInstanceOf(BizException.class);
verifyNoInteractions(files, storage);
}
/** 真实 PDF、JPG、PNG 均可写入并保持内容;上传不以扩展名代替 MIME 和签名。 */
@ParameterizedTest
@ValueSource(strings = {VEHICLE, DRIVER})
void storesPdfJpegPngAndRejectsEmptyUnsupportedAndSpoofedContent(String type) throws Exception {
var storage = storage();
var category = BusinessFileCategory.require(type);
for (var file : new MockMultipartFile[]{pdf(),
new MockMultipartFile("file", "vehicle.jpg", "image/jpeg", image("jpeg")),
new MockMultipartFile("file", "driver.png", "image/png", image("png"))}) {
var saved = storage.store(0, "71", file, category);
assertThat(storage.read(saved.objectKey())).isEqualTo(file.getBytes());
assertThat(saved.contentType()).isEqualTo(file.getContentType());
assertThat(saved.size()).isEqualTo(file.getSize());
assertThat(saved.sha256()).matches("[0-9a-f]{64}");
}
for (var file : new MockMultipartFile[]{
new MockMultipartFile("file", "empty.pdf", "application/pdf", new byte[0]),
new MockMultipartFile("file", "fake.pdf", "application/pdf", "plain text".getBytes(StandardCharsets.UTF_8)),
new MockMultipartFile("file", "fake.jpg", "image/jpeg", image("png")),
new MockMultipartFile("file", "fake.png", "image/png", image("jpeg")),
new MockMultipartFile("file", "fake.pdf", "text/plain", pdf().getBytes()),
new MockMultipartFile("file", "fake.pdf", "application/octet-stream", pdf().getBytes()),
new MockMultipartFile("file", "missing.pdf", null, pdf().getBytes())}) {
assertThatThrownBy(() -> storage.store(0, "71", file, category)).isInstanceOf(BizException.class);
}
assertThatThrownBy(() -> storage.store(0, "71", null, category)).isInstanceOf(BizException.class);
}
/** 10MiB 为包含边界,超限在读取内容或落盘前拒绝。 */
@ParameterizedTest
@ValueSource(strings = {VEHICLE, DRIVER})
void acceptsExactlyTenMibAndRejectsOneByteOverBeforeReading(String type) throws Exception {
var storage = storage();
var category = BusinessFileCategory.require(type);
byte[] content = Arrays.copyOf(pdf().getBytes(), MAX_BYTES);
var boundary = new MockMultipartFile("file", "boundary.pdf", "application/pdf", content);
var stored = storage.store(0, "71", boundary, category);
assertThat(Files.size(root.resolve(stored.objectKey()))).isEqualTo(MAX_BYTES);
var oversized = mock(MultipartFile.class);
when(oversized.isEmpty()).thenReturn(false);
when(oversized.getSize()).thenReturn((long) MAX_BYTES + 1);
assertThatThrownBy(() -> storage.store(0, "71", oversized, category))
.isInstanceOf(BizException.class).hasMessageContaining("10MB");
verify(oversized, never()).getInputStream();
verify(oversized, never()).transferTo(any(Path.class));
}
/** 上传生成独立不可变对象和真实元数据;替换引用不覆盖原文件。 */
@ParameterizedTest
@ValueSource(strings = {VEHICLE, DRIVER})
void uploadsKeepPlatformDispatchScopeAndImmutableObjects(String type) throws Exception {
var files = mock(FileObjectMapper.class);
var storage = storage();
var service = service(files, storage);
var ids = new AtomicLong(500);
when(files.insert(any(FileObjectEntity.class))).thenAnswer(call -> {
FileObjectEntity row = call.getArgument(0);
row.setId(ids.incrementAndGet());
return 1;
});
var first = service.upload(0, type, "71", 7, pdf());
var secondFile = new MockMultipartFile("file", "updated.pdf", "application/pdf",
"%PDF-1.7\nupdated".getBytes(StandardCharsets.US_ASCII));
var second = service.upload(0, type, "71", 7, secondFile);
var rows = org.mockito.ArgumentCaptor.forClass(FileObjectEntity.class);
verify(files, times(2)).insert(rows.capture());
assertThat(first.ownerScope()).isEqualTo("PLATFORM");
assertThat(first.tenantId()).isZero();
assertThat(first.businessType()).isEqualTo(type);
assertThat(first.businessId()).isEqualTo("71");
assertThat(first.fileId()).isEqualTo(501L);
assertThat(second.fileId()).isEqualTo(502L);
assertThat(first.fileName()).isEqualTo("evidence.pdf");
assertThat(first.contentType()).isEqualTo("application/pdf");
assertThat(first.sizeBytes()).isEqualTo(pdf().getSize());
assertThat(first.sha256()).matches("[0-9a-f]{64}");
assertThat(first.createdAt()).isNotNull().isEqualTo(rows.getAllValues().get(0).getCreatedAt());
assertThat(rows.getAllValues().get(0).getObjectKey()).isNotEqualTo(rows.getAllValues().get(1).getObjectKey());
assertThat(storage.read(rows.getAllValues().get(0).getObjectKey())).isEqualTo(pdf().getBytes());
assertThat(storage.read(rows.getAllValues().get(1).getObjectKey())).isEqualTo(secondFile.getBytes());
verify(files, never()).updateById(any(FileObjectEntity.class));
}
/** 元数据和下载均逐列带全复合键;错车、错类别、错文件不得读取存储内容。 */
@ParameterizedTest
@ValueSource(strings = {VEHICLE, DRIVER})
void metadataAndDownloadEnforceEveryScopeKeyBeforeReading(String type) throws Exception {
var files = mock(FileObjectMapper.class);
var storage = mock(BusinessFileStorage.class);
var service = service(files, storage);
var row = new FileObjectEntity();
row.setId(501L); row.setTenantId(0L); row.setBusinessType(type); row.setBusinessId("71");
row.setOriginalName("evidence.pdf"); row.setContentType("application/pdf");
row.setObjectKey("business-files/0/71/evidence.pdf"); row.setSizeBytes(pdf().getSize());
row.setSha256("a".repeat(64)); row.setCreatedAt(java.time.LocalDateTime.now());
when(files.selectOne(any())).thenAnswer(call -> {
LambdaQueryWrapper<FileObjectEntity> query = call.getArgument(0);
assertThat(boundValue(query, "status")).isEqualTo("ACTIVE");
assertThat(boundValue(query, "deleted")).isEqualTo(false);
return Long.valueOf(0).equals(boundValue(query, "tenant_id"))
&& type.equals(boundValue(query, "business_type"))
&& "71".equals(boundValue(query, "business_id"))
&& Long.valueOf(501).equals(boundValue(query, "id")) ? row : null;
});
when(storage.read(row.getObjectKey())).thenReturn(pdf().getBytes());
var metadata = service.metadata(0, type, "71", 501);
assertThat(metadata.fileId()).isEqualTo(501L);
assertThat(metadata.ownerScope()).isEqualTo("PLATFORM");
assertThat(service.download(0, type, "71", 501).content()).isEqualTo(pdf().getBytes());
verify(storage).read(row.getObjectKey());
clearInvocations(storage);
String otherType = VEHICLE.equals(type) ? DRIVER : VEHICLE;
for (String candidate : new String[]{otherType, "FLEET_DRIVER_LICENSE", "FLEET_TRIP_OPERATION_EVIDENCE"}) {
assertThatThrownBy(() -> service.metadata(0, candidate, "71", 501))
.isInstanceOf(BizException.class).hasMessageContaining("归属不匹配");
assertThatThrownBy(() -> service.download(0, candidate, "71", 501))
.isInstanceOf(BizException.class).hasMessageContaining("归属不匹配");
}
assertThatThrownBy(() -> service.metadata(0, type, "72", 501)).isInstanceOf(BizException.class);
assertThatThrownBy(() -> service.download(0, type, "72", 501)).isInstanceOf(BizException.class);
assertThatThrownBy(() -> service.metadata(0, type, "71", 502)).isInstanceOf(BizException.class);
assertThatThrownBy(() -> service.download(0, type, "71", 502)).isInstanceOf(BizException.class);
verifyNoInteractions(storage);
}
/** 内部服务令牌在业务访问前校验,不对未授权请求暴露元数据或文件。 */
@ParameterizedTest
@ValueSource(strings = {VEHICLE, DRIVER})
void invalidInternalTokenCannotUploadReadMetadataOrDownload(String type) {
var service = mock(InternalBusinessFileService.class);
var controller = new InternalBusinessFileController();
ReflectionTestUtils.setField(controller, "expected", "dispatch-test-token");
ReflectionTestUtils.setField(controller, "service", service);
for (String token : new String[]{null, "", "wrong-token"}) {
assertThatThrownBy(() -> controller.upload(token, 7, 0, type, "71", pdf())).isInstanceOf(BizException.class);
assertThatThrownBy(() -> controller.metadata(token, 0, type, "71", 501)).isInstanceOf(BizException.class);
assertThatThrownBy(() -> controller.download(token, 0, type, "71", 501)).isInstanceOf(BizException.class);
}
verifyNoInteractions(service);
}
/** 从实际 SQL 绑定中取指定列的等值条件,缺少任一隔离条件直接失败。 */
private static Object boundValue(LambdaQueryWrapper<FileObjectEntity> query, String column) {
var matcher = Pattern.compile("(?<![A-Za-z0-9_])" + column
+ " = #\\{ew\\.paramNameValuePairs\\.([^}]+)}").matcher(query.getSqlSegment());
assertThat(matcher.find()).as("复合归属条件 %s", column).isTrue();
return query.getParamNameValuePairs().get(matcher.group(1));
}
/** 创建隔离临时目录中的真实存储,不访问运行环境。 */
private BusinessFileStorage storage() {
var storage = new BusinessFileStorage();
ReflectionTestUtils.setField(storage, "configuredRoot", root);
storage.initializeRoot();
return storage;
}
/** 复用生产服务,数据库边界由 Mapper 替身记录实际查询。 */
private InternalBusinessFileService service(FileObjectMapper files, BusinessFileStorage storage) {
var service = new InternalBusinessFileService();
ReflectionTestUtils.setField(service, "files", files);
ReflectionTestUtils.setField(service, "storage", storage);
return service;
}
/** 提供具有真实 PDF 文件头的最小上传内容。 */
private static MockMultipartFile pdf() {
return new MockMultipartFile("file", "evidence.pdf", "application/pdf",
"%PDF-1.7\nevidence".getBytes(StandardCharsets.US_ASCII));
}
/** 使用图像编码器生成真实 JPG、PNG,避免测试只验证扩展名。 */
private static byte[] image(String format) throws java.io.IOException {
var output = new ByteArrayOutputStream();
var image = new java.awt.image.BufferedImage(2, 2, java.awt.image.BufferedImage.TYPE_INT_RGB);
assertThat(javax.imageio.ImageIO.write(image, format, output)).isTrue();
return output.toByteArray();
}
}
@@ -28,6 +28,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoInteractions;
import static org.mockito.Mockito.when;
@SpringJUnitConfig(classes = {ExportTaskService.class, ExportTaskServiceTest.TestConfig.class})
@@ -38,6 +39,23 @@ class ExportTaskServiceTest {
@MockBean private ExportStateService states;
@MockBean private ExportMetrics metrics;
@Resource private ExportTaskService service;
@Test void turnoverKeepsBoundedSignedContextAndRequiresIndependentExportPermission() {
var definition=definition();definition.setRequiredPermission("platform:self-operated-analytics:export");
when(registry.require("SELFOP_INVENTORY_TURNOVER")).thenReturn(definition);
when(states.createConstrained(any(FileExportTask.class))).thenAnswer(c->new ExportStateService.CreationResult(c.getArgument(0),true));
Map<String,Object> parameters=new LinkedHashMap<>();
parameters.put("sourceAccount","demo");parameters.put("warehouseCode","W");parameters.put("endDate","2026-10-14");parameters.put("baseWindowDays",30);
parameters.put("snapshotContext","x".repeat(15000));parameters.put("columns",List.of("sku","quantityTurnoverRate"));parameters.put("expectedTotal",205);
var request=new CreateExportTaskRequest("SELFOP_INVENTORY_TURNOVER","XLSX","库存周转",parameters);
assertThrows(BizException.class,()->service.create(user(1L,Set.of("platform:self-operated-analytics:list")),request));
assertEquals("PENDING",service.create(user(1L,Set.of("platform:self-operated-analytics:export")),request).status());
parameters.put("snapshotContext","x".repeat(16001));
assertThrows(BizException.class,()->service.create(user(1L,Set.of("platform:self-operated-analytics:export")),request));
parameters.put("snapshotContext","fixed");parameters.put("current",2);
assertThrows(BizException.class,()->service.create(user(1L,Set.of("platform:self-operated-analytics:export")),request));
parameters.remove("current");parameters.remove("columns");
assertThrows(BizException.class,()->service.create(user(1L,Set.of("platform:self-operated-analytics:export")),request));
}
@Test
void createsPersistedTaskOnlyWhenSourceExportPermissionIsPresent() {
when(registry.require("CUSTOMER_LIST")).thenReturn(definition());
@@ -55,6 +73,32 @@ class ExportTaskServiceTest {
assertEquals(ResultCode.FORBIDDEN, denied.getResultCode());
}
@Test
void operationExportDerivesCostVisibilityFromAuthenticatedPermissions() {
var definition = definition();
definition.setRequiredPermission("platform:fleet:operations:export");
when(registry.require("TRIP_OPERATIONS_LIST")).thenReturn(definition);
when(states.createConstrained(any(FileExportTask.class))).thenAnswer(invocation ->
new ExportStateService.CreationResult(invocation.getArgument(0), true));
service.create(user(1L, Set.of("platform:fleet:operations:export")),
new CreateExportTaskRequest("TRIP_OPERATIONS_LIST", "XLSX", "出车记录", Map.of("costVisible", true)));
var captured = org.mockito.ArgumentCaptor.forClass(FileExportTask.class);
verify(states).createConstrained(captured.capture());
assertTrue(captured.getValue().getParametersJson().contains("\"costVisible\":false"));
}
@Test
void costPermissionCannotBeBypassedByDownloadAllOrRetry() {
FileExportTask task = new FileExportTask();
task.setId(9L); task.setTenantId(0L); task.setAppCode("PLATFORM"); task.setRequestedBy(2L);
task.setExportType("TRIP_OPERATIONS_LIST"); task.setParametersJson("{\"costVisible\":true}");
when(repository.find(9L)).thenReturn(task);
var reader = user(1L, Set.of("platform:download:all", "platform:fleet:operations:export"));
assertEquals(ResultCode.FORBIDDEN, assertThrows(BizException.class, () -> service.download(reader,9L)).getResultCode());
assertEquals(ResultCode.FORBIDDEN, assertThrows(BizException.class, () -> service.retry(reader,9L)).getResultCode());
verifyNoInteractions(storage);
}
@Test
void refusesAnotherUsersTaskUnlessDownloadAllIsGranted() {
when(registry.require("CUSTOMER_LIST")).thenReturn(definition());
@@ -67,6 +111,15 @@ class ExportTaskServiceTest {
assertEquals("9", service.get(user(1L, Set.of("platform:download:all")), 9L).id());
}
@Test void turnoverDownloadAndRetryRecheckExportPermissionEvenWithDownloadAll() {
var task=new FileExportTask();task.setId(9L);task.setTenantId(0L);task.setAppCode("PLATFORM");task.setRequestedBy(2L);
task.setExportType("SELFOP_INVENTORY_TURNOVER");task.setStatus("SUCCEEDED");when(repository.find(9L)).thenReturn(task);
var reader=user(1L,Set.of("platform:download:all","platform:self-operated-analytics:list"));
assertEquals(ResultCode.FORBIDDEN,assertThrows(BizException.class,()->service.download(reader,9L)).getResultCode());
assertEquals(ResultCode.FORBIDDEN,assertThrows(BizException.class,()->service.retry(reader,9L)).getResultCode());
verifyNoInteractions(storage);
}
@Test
void rejectsParametersDeeperThanTwoLevels() {
when(registry.require("CUSTOMER_LIST")).thenReturn(definition());
@@ -66,6 +66,24 @@ class GenericXlsxExportRunnerTest {
assertNull(requests.getAllValues().get(0).snapshotToken());assertEquals("snapshot-9",requests.getAllValues().get(1).snapshotToken());
}
@Test void turnoverWorkbookPreservesColumnOrderPercentUnknownAndLiteralSku() throws Exception {
var columns=List.of(new ExportColumn("quantityTurnoverRate","期间周转率",ExportColumnType.STRING,24),
new ExportColumn("sku","SKU",ExportColumnType.STRING,24),new ExportColumn("historyDays","合格历史库存天数",ExportColumnType.STRING,24));
var batch=new ExportBatchResponse(1,"sha256:turnover","fixed",columns,List.of(
Map.of("quantityTurnoverRate","125%","sku","=SUM(1,2)","historyDays","30/30"),
Map.of("quantityTurnoverRate","—","sku","未知商品","historyDays","29/30"),
Map.of("quantityTurnoverRate","0%","sku","零销量","historyDays","30/30")),"3",false,3L);
when(provider.batch(anyString(),eq("SELFOP_INVENTORY_TURNOVER"),any(),any())).thenReturn(ApiResponse.success(batch));
var task=new FileExportTask();task.setId(18L);task.setTenantId(0L);task.setAppCode("PLATFORM");task.setRequestedBy(7L);task.setDispatchVersion(1);
task.setExportType("SELFOP_INVENTORY_TURNOVER");task.setTaskName("库存周转");task.setParametersJson("{\"snapshotContext\":\"fixed\"}");
var definition=new ExportDefinitionRegistry.Definition();definition.setMaxRows(200000);definition.setBatchSize(100);
var result=runner.run(task,definition,new AtomicBoolean(),ignored->{});
try(var workbook=new XSSFWorkbook(storage.load(result.objectKey()).getInputStream())) {
var sheet=workbook.getSheetAt(0);assertEquals("期间周转率",sheet.getRow(0).getCell(0).getStringCellValue());
assertEquals("125%",sheet.getRow(1).getCell(0).getStringCellValue());assertEquals("'=SUM(1,2)",sheet.getRow(1).getCell(1).getStringCellValue());
assertEquals("—",sheet.getRow(2).getCell(0).getStringCellValue());assertEquals("0%",sheet.getRow(3).getCell(0).getStringCellValue());assertEquals(3,result.rows());
}
}
@Test void deletesTheCompletedFileWhenReadingItsFinalSizeFails() throws Exception {
var batch=new ExportBatchResponse(1,"sha256:test","snapshot-9",
List.of(new ExportColumn("text","文本",ExportColumnType.STRING,18)),
@@ -0,0 +1,36 @@
package com.baiyue.file.service;
import com.baiyue.common.core.exception.BizException;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.test.util.ReflectionTestUtils;
import org.springframework.web.multipart.MultipartFile;
import java.nio.file.Path;
import java.util.List;
import static org.assertj.core.api.Assertions.*;
import static org.mockito.Mockito.*;
class ProcurementFilePolicyTest {
@TempDir Path root;
@Test void procurementLabelAndPrivateProofUsePdfImagesAndPositiveCustomerOwnership() {
var storage=new BusinessFileStorage();ReflectionTestUtils.setField(storage,"configuredRoot",root);storage.initializeRoot();
for(var category:List.of(BusinessFileCategory.OVERSEAS_PROCUREMENT_LABEL,BusinessFileCategory.OVERSEAS_PROCUREMENT_PURCHASE,
BusinessFileCategory.OVERSEAS_PROCUREMENT_BUDGET,BusinessFileCategory.OVERSEAS_PROCUREMENT_EXCEPTION)) {
category.validateOwner(9);
assertThatThrownBy(()->category.validateOwner(0)).isInstanceOf(BizException.class);
assertThatThrownBy(()->category.storageBusinessId("0")).isInstanceOf(BizException.class);
byte[] pdf="%PDF-1.4\nprocurement test".getBytes(java.nio.charset.StandardCharsets.UTF_8);
var saved=storage.store(9,"11",new MockMultipartFile("file","label.pdf","application/pdf",pdf),category);
assertThat(storage.read(saved.objectKey())).isEqualTo(pdf);
assertThatThrownBy(()->storage.store(9,"11",new MockMultipartFile("file","fake.pdf","application/pdf","<html>fake</html>".getBytes()),category)).isInstanceOf(BizException.class);
assertThatThrownBy(()->storage.store(9,"11",new MockMultipartFile("file","notes.txt","text/plain","notes".getBytes()),category)).isInstanceOf(BizException.class);
}
}
@Test void labelOverTenMibIsRejectedBeforeReadingBody()throws Exception {
var storage=new BusinessFileStorage();ReflectionTestUtils.setField(storage,"configuredRoot",root);storage.initializeRoot();
MultipartFile file=mock(MultipartFile.class);when(file.isEmpty()).thenReturn(false);when(file.getSize()).thenReturn(10L*1024*1024+1);
assertThatThrownBy(()->storage.store(9,"11",file,BusinessFileCategory.OVERSEAS_PROCUREMENT_LABEL)).isInstanceOf(BizException.class);
verify(file,never()).getBytes();verify(file,never()).getInputStream();
}
}
+5
View File
@@ -1,5 +1,10 @@
# Finance Service Instructions
## 数据库访问与中文注释约束
- 强制遵守根 `../AGENTS.md` 的“数据库访问与中文代码注释”全部规则:正常业务访问统一为 `Controller → Service → Repository → Mapper`,不得省略 Repository 或跨层直调;生产 SQL 由 Mapper 执行,Repository 不得直接使用 JdbcTemplate 或原生 JDBC。非 HTTP 入口从 Service 进入;无数据库模块不引入数据库访问。
- 每个手写方法及构造器须有简短中文说明;核心业务规则、复杂 SQL、事务、锁、幂等、并发及失败处理须补充适量中文注释,重点说明原因和边界。新增、修改方法立即执行,触及的存量代码同步整改。
## 模块定位
- 本模块是独立财务服务,拥有客户结算条款、财务费用来源、CNY 账单与明细、客户资金账户及充值申请、应收款月度统计、客户对账确认、收款及分配、成本及分摊、账单修订、单据编号、幂等记录和财务审计状态。
@@ -130,6 +130,14 @@ public class BusinessFeeSourceEventService {
}
positive(value.sourceFeeId(), "sourceFeeId");
positive(value.customerId(), "customerId");
if (value.walletSettlement() != null) {
if (!"RECEIVABLE".equals(value.direction())) throw error("FIN-EVT-012", "钱包消费只能关联应收费用");
positive(value.walletSettlement().holdId(), "walletSettlement.holdId");
positive(value.walletSettlement().ledgerId(), "walletSettlement.ledgerId");
if (blank(value.walletSettlement().commandEventId())) throw error("FIN-EVT-012", "缺少原资金命令引用");
} else if ("OVERSEAS_PROCUREMENT_FEE".equals(value.sourceType()) && "RECEIVABLE".equals(value.direction())) {
throw error("FIN-EVT-012", "采购应收必须引用成功实扣资金,不能进入待收费池");
}
if ("OVERSEAS_CONTAINER_FEE".equals(value.sourceType())) {
if (!"LASTLEG".equals(value.sourceSystem()) || !"OVERSEAS_CONTAINER".equals(value.businessType()))
throw error("FIN-EVT-012", "海外柜费来源不一致");
@@ -160,7 +168,7 @@ public class BusinessFeeSourceEventService {
value.paymentReferenceNo(), value.paymentVoucherFileIds(), value.businessDate(), value.currency(),
value.totalAmount(), value.originalCurrency(), value.originalAmount(), value.exchangeRate(),
value.exchangeRateMonth(), value.chargeableQuantity(), value.quantityUnit(), value.unitPrice(),
value.periodStart(), value.periodEnd(), value.reviewStatus(), "PUBLISHED", "ACTIVE", null);
value.periodStart(), value.periodEnd(), value.reviewStatus(), "PUBLISHED", "ACTIVE", null, value.walletSettlement());
String expected = EventPayloadHash.sha256(EventPayloadCanonicalizer.canonicalize(objectMapper.valueToTree(unsigned)));
if (!expected.equals(value.sourceHash())) throw error("FIN-EVT-004", "费用来源快照哈希不一致");
}
@@ -189,7 +197,40 @@ public class BusinessFeeSourceEventService {
private void linkSettledWalletHold(long feeSourceId, BusinessFeeSourceChangedV1 source) {
if (!"RECEIVABLE".equals(source.direction())) return;
jdbc.update("UPDATE fin_fee_source f JOIN fin_wallet_hold h ON h.customer_id=f.customer_id AND h.business_type=f.business_type AND h.business_no=f.business_no SET f.wallet_hold_id=h.id,f.status='SETTLED' WHERE f.id=? AND f.status='AVAILABLE' AND h.status='SETTLED' AND h.amount=f.amount",
if (source.walletSettlement() != null) {
var reference = source.walletSettlement();
long customerId = positive(source.customerId(), "customerId");
long holdId = positive(reference.holdId(), "holdId");
long ledgerId = positive(reference.ledgerId(), "ledgerId");
List<Map<String, Object>> rows = jdbc.queryForList(
"SELECT l.amount,c.result_json FROM fin_wallet_hold h JOIN fin_wallet_ledger l ON l.id=h.action_ledger_id AND l.customer_id=h.customer_id JOIN fin_wallet_command_inbox c ON c.event_id=? AND c.status='SUCCEEDED' WHERE h.id=? AND l.id=? AND h.customer_id=? AND h.business_type=? AND h.business_no=? AND h.status='SETTLED' AND l.change_type='CONSUMPTION' FOR UPDATE",
reference.commandEventId(), holdId, ledgerId, customerId, source.businessType(), source.businessNo());
if (rows.size() != 1 || !(rows.get(0).get("amount") instanceof java.math.BigDecimal amount)
|| amount.negate().compareTo(source.totalAmount()) != 0) {
throw error("FIN-EVT-017", "费用来源与成功扣款的客户、业务或金额不匹配");
}
com.fasterxml.jackson.databind.JsonNode result;
try { result = objectMapper.readTree(String.valueOf(rows.get(0).get("result_json"))); }
catch (JsonProcessingException exception) { throw error("FIN-EVT-017", "原资金结果无法核对"); }
if (!"SUCCEEDED".equals(result.path("result").asText())
|| !Set.of("SETTLE", "SETTLE_ACTUAL").contains(result.path("operation").asText())
|| !reference.commandEventId().equals(result.path("commandEventId").asText())
|| !reference.holdId().equals(result.path("walletHoldId").asText())
|| !reference.ledgerId().equals(result.path("walletLedgerId").asText())
|| result.path("customerId").asLong() != customerId
|| !source.businessType().equals(result.path("businessType").asText())
|| !source.businessNo().equals(result.path("businessNo").asText())
|| result.path("amount").decimalValue().compareTo(source.totalAmount()) != 0) {
throw error("FIN-EVT-017", "费用来源引用的资金结果不匹配");
}
List<Long> used = jdbc.queryForList("SELECT id FROM fin_fee_source WHERE wallet_hold_id=? AND id<>? FOR UPDATE",
Long.class, holdId, feeSourceId);
if (!used.isEmpty()) throw error("FIN-EVT-017", "同一成功扣款已关联其他费用来源");
jdbc.update("UPDATE fin_fee_source SET wallet_hold_id=?,status='SETTLED' WHERE id=? AND customer_id=? AND status='AVAILABLE'",
holdId, feeSourceId, customerId);
return;
}
jdbc.update("UPDATE fin_fee_source f JOIN fin_wallet_hold h ON h.customer_id=f.customer_id AND h.business_type=f.business_type AND h.business_no=f.business_no JOIN fin_wallet_ledger l ON l.id=h.action_ledger_id AND l.customer_id=h.customer_id AND l.change_type='CONSUMPTION' SET f.wallet_hold_id=h.id,f.status='SETTLED' WHERE f.id=? AND f.status='AVAILABLE' AND h.status='SETTLED' AND f.amount=-l.amount",
feeSourceId);
}
@@ -300,6 +300,113 @@ public class FinanceWalletService {
return completeHold(customerId, businessType, businessNo, idempotencyKey, request, false);
}
/** Settles one estimate without releasing its protection before checking any shortfall. */
@Transactional
public WalletHold settleActual(long customerId, String rawBusinessType, String rawBusinessNo,
String idempotencyKey, BigDecimal actualAmount, String remark) {
requirePositive(customerId, "客户");
BigDecimal amount = money(actualAmount);
String businessType = businessType(rawBusinessType);
String businessNo = businessNo(rawBusinessNo);
String operation = "WALLET_HOLD_SETTLE_ACTUAL";
String requestHash = hash(Map.of("customerId", customerId, "businessType", businessType,
"businessNo", businessNo, "amount", amount, "remark", String.valueOf(remark)));
Long replay = reserve(customerId, 0, operation, idempotencyKey, requestHash);
if (replay != null) return requiredHold(replay, customerId);
WalletAccount before = accountForUpdate(customerId);
WalletHold hold = findHold(customerId, businessType, businessNo, true);
if (hold == null) throw error("FIN-WALLET-HOLD-404", "资金冻结记录不存在");
if (!"FROZEN".equals(hold.status())) throw error("FIN-WALLET-HOLD-409", "资金冻结记录已处理");
WalletAccount after = settleActualAccount(before, hold, amount);
updateAccount(customerId, after, before.version(), 0);
WalletLedgerEntry ledger = insertLedger(customerId, "CONSUMPTION", amount.negate(), after,
businessType, businessNo, LocalDate.now(), null, businessNo, 0, "业务系统", remark);
// The hold retains the original estimate; its action ledger records the actual charge.
int updated = jdbc.update("UPDATE fin_wallet_hold SET status='SETTLED',action_ledger_id=?,completed_at=CURRENT_TIMESTAMP(3) WHERE id=? AND status='FROZEN'",
ledger.ledgerId(), hold.holdId());
if (updated != 1) throw error("FIN-WALLET-HOLD-409", "资金冻结记录已处理");
audit(customerId, "WALLET_HOLD", hold.holdId(), "SETTLE_ACTUAL", remark, before, after, 0, "业务系统");
complete(customerId, 0, operation, idempotencyKey, hold.holdId());
return requiredHold(hold.holdId(), customerId);
}
/** Refunds a successful consumption; recharge allocation rules apply without creating a recharge. */
@Transactional
public WalletLedgerEntry refundConsumption(long customerId, long originalLedgerId, String refundNo,
String idempotencyKey, BigDecimal refundAmount,
long operatorId, String operatorName, String remark) {
requirePositive(customerId, "客户");
requirePositive(originalLedgerId, "原扣款流水");
String reference = businessNo(refundNo);
BigDecimal amount = money(refundAmount);
if (!StringUtils.hasText(remark)) throw bad("退款原因不能为空");
String requestHash = hash(Map.of("customerId", customerId, "originalLedgerId", originalLedgerId,
"refundNo", reference, "amount", amount, "remark", remark));
Long replay = reserve(customerId, 0, "WALLET_BUSINESS_REFUND", idempotencyKey, requestHash);
if (replay != null) return requiredLedger(replay, customerId);
WalletAccount before = accountForUpdate(customerId);
List<WalletLedgerEntry> originals = jdbc.query(
"SELECT * FROM fin_wallet_ledger WHERE id=? AND customer_id=? FOR UPDATE",
(rs, n) -> ledgerRow(rs), originalLedgerId, customerId);
if (originals.isEmpty()) throw error("FIN-WALLET-404", "原扣款流水不存在");
WalletLedgerEntry original = originals.get(0);
if (!"CONSUMPTION".equals(original.changeType()) || original.amount().signum() >= 0) {
throw bad("仅可对成功业务扣款发起关联退款");
}
List<WalletLedgerEntry> existing = jdbc.query(
"SELECT * FROM fin_wallet_ledger WHERE customer_id=? AND source_type='BUSINESS_REFUND' AND source_no=? FOR UPDATE",
(rs, n) -> ledgerRow(rs), customerId, reference);
if (!existing.isEmpty()) {
WalletLedgerEntry refunded = existing.get(0);
if (refunded.amount().compareTo(amount) != 0 || !original.businessNo().equals(refunded.referenceNo())) {
throw error("FIN-IDEMPOTENCY-CONFLICT", "同一退款单对应的原扣款或金额不一致");
}
complete(customerId, 0, "WALLET_BUSINESS_REFUND", idempotencyKey, refunded.ledgerId());
return refunded;
}
// Locking reads see refunds committed while this transaction waited for the account lock,
// even under MySQL REPEATABLE READ after the idempotency lookup established a snapshot.
BigDecimal refunded = jdbc.queryForList(
"SELECT amount FROM fin_wallet_ledger WHERE customer_id=? AND source_type='BUSINESS_REFUND' AND reference_no=? FOR UPDATE",
BigDecimal.class, customerId, original.businessNo()).stream().reduce(BigDecimal.ZERO, BigDecimal::add);
if (refunded.add(amount).compareTo(original.amount().negate()) > 0) {
throw error("FIN-WALLET-REFUND-EXCEEDED", "退款金额超过原扣款剩余可退金额");
}
WalletAccount after = rechargeAccount(before, amount);
updateAccount(customerId, after, before.version(), operatorId);
WalletLedgerEntry result = insertLedger(customerId, "REFUND", amount, after,
"BUSINESS_REFUND", reference, LocalDate.now(), null, original.businessNo(),
operatorId, operatorName, remark);
audit(customerId, "WALLET_LEDGER", originalLedgerId, "REFUND", remark, before, after, operatorId, operatorName);
complete(customerId, 0, "WALLET_BUSINESS_REFUND", idempotencyKey, result.ledgerId());
return result;
}
WalletAccount settleActualAccount(WalletAccount before, WalletHold hold, BigDecimal actualAmount) {
BigDecimal amount = money(actualAmount);
BigDecimal extra = amount.subtract(hold.amount()).max(BigDecimal.ZERO);
if (extra.signum() > 0 && before.availableBalance().compareTo(extra) < 0) {
throw error("FIN-WALLET-INSUFFICIENT", "实际费用补差所需的可用余额和授信额度不足");
}
BigDecimal actual = before.actualBalance();
BigDecimal creditUsed = before.creditUsed();
if (before.creditActive()) {
BigDecimal reservedCharge = amount.min(hold.amount());
BigDecimal cashCharge = reservedCharge.min(hold.actualFrozenAmount());
BigDecimal freeCash = actual.subtract(before.frozenBalance().subtract(before.creditFrozen()))
.max(BigDecimal.ZERO);
cashCharge = cashCharge.add(extra.min(freeCash));
actual = actual.subtract(cashCharge);
creditUsed = creditUsed.add(amount.subtract(cashCharge));
} else {
// Previously reserved credit still settles after expiry, without granting new credit.
actual = actual.subtract(amount);
}
return accountState(actual, before.frozenBalance().subtract(hold.amount()), before.creditLimit(),
creditUsed, before.creditFrozen().subtract(hold.creditFrozenAmount()),
before.creditExpiresOn(), before.version());
}
private WalletHold completeHold(long customerId, String rawBusinessType, String rawBusinessNo,
String idempotencyKey, WalletHoldActionRequest request, boolean settle) {
requirePositive(customerId, "客户");
@@ -29,9 +29,10 @@ import java.util.Set;
@Service
public class WalletCommandEventService {
private static final Set<String> OPERATIONS = Set.of("FREEZE", "SETTLE", "RELEASE");
private static final Set<String> OPERATIONS = Set.of("FREEZE", "SETTLE", "SETTLE_ACTUAL", "RELEASE", "REFUND");
private static final Set<String> FINAL_REJECTIONS = Set.of(
"FIN-WALLET-INSUFFICIENT", "FIN-WALLET-HOLD-409", "FIN-IDEMPOTENCY-CONFLICT", "FIN-REQ-400");
"FIN-WALLET-INSUFFICIENT", "FIN-WALLET-HOLD-409", "FIN-IDEMPOTENCY-CONFLICT", "FIN-REQ-400",
"FIN-WALLET-REFUND-EXCEEDED", "FIN-WALLET-404");
private final JdbcTemplate jdbc;
private final ObjectMapper objectMapper;
private final FinanceWalletService walletService;
@@ -56,10 +57,9 @@ public class WalletCommandEventService {
if (resultExists(envelope.eventId())) return DeliveryAck.of(envelope, DeliveryAck.Outcome.DUPLICATE);
// Wallet methods join this transaction: money, the Inbox outcome and
// the result Outbox commit together, or all roll back.
WalletHold hold = execute(command);
if (hold == null) throw new IllegalStateException("资金操作未返回处理结果");
ExecutionResult execution = execute(command);
finalizeResult(envelope, completed(envelope.eventId(), command, "SUCCEEDED",
hold.status(), hold.amount(), null, null));
execution.status(), execution.amount(), null, null, execution.holdId(), execution.ledgerId()));
return DeliveryAck.of(envelope, DeliveryAck.Outcome.APPLIED);
});
} catch (FinanceEventException exception) {
@@ -70,7 +70,7 @@ public class WalletCommandEventService {
requireLockedIdentity(envelope);
if (resultExists(envelope.eventId())) return DeliveryAck.of(envelope, DeliveryAck.Outcome.DUPLICATE);
finalizeResult(envelope, completed(envelope.eventId(), command, "FAILED",
null, command.amount(), exception.code(), exception.getMessage()));
null, command.amount(), exception.code(), exception.getMessage(), null, null));
return DeliveryAck.of(envelope, DeliveryAck.Outcome.APPLIED);
});
}
@@ -86,21 +86,33 @@ public class WalletCommandEventService {
}
}
private WalletHold execute(WalletCommandRequestedV1 command) {
private record ExecutionResult(String status, BigDecimal amount, String holdId, String ledgerId) { }
private ExecutionResult execute(WalletCommandRequestedV1 command) {
if ("REFUND".equals(command.operation())) {
var refund = walletService.refundConsumption(command.customerId(), Long.parseLong(command.originalLedgerId()),
command.businessNo(), command.idempotencyKey(), command.amount(), 0, "业务系统", command.remark());
return new ExecutionResult("REFUNDED", refund.amount(), null, String.valueOf(refund.ledgerId()));
}
WalletHold hold = switch (command.operation()) {
case "FREEZE" -> walletService.freeze(command.customerId(), command.idempotencyKey(),
new WalletFreezeRequest(command.amount(), command.businessType(), command.businessNo(), command.remark()));
case "SETTLE" -> walletService.settle(command.customerId(), command.businessType(), command.businessNo(),
command.idempotencyKey(), new WalletHoldActionRequest(command.remark()));
case "SETTLE_ACTUAL" -> walletService.settleActual(command.customerId(), command.businessType(), command.businessNo(),
command.idempotencyKey(), command.amount(), command.remark());
case "RELEASE" -> walletService.release(command.customerId(), command.businessType(), command.businessNo(),
command.idempotencyKey(), new WalletHoldActionRequest(command.remark()));
default -> throw new FinanceEventException("FIN-EVT-001", "资金指令操作无效");
};
if ("SETTLE".equals(command.operation())) {
jdbc.update("UPDATE fin_fee_source f JOIN fin_wallet_hold h ON h.customer_id=f.customer_id AND h.business_type=f.business_type AND h.business_no=f.business_no SET f.wallet_hold_id=h.id,f.status='SETTLED' WHERE h.id=? AND f.direction='RECEIVABLE' AND f.status='AVAILABLE' AND f.amount=h.amount",
if (hold == null) throw new IllegalStateException("资金操作未返回处理结果");
if (Set.of("SETTLE", "SETTLE_ACTUAL").contains(command.operation())) {
jdbc.update("UPDATE fin_fee_source f JOIN fin_wallet_hold h ON h.customer_id=f.customer_id AND h.business_type=f.business_type AND h.business_no=f.business_no JOIN fin_wallet_ledger l ON l.id=h.action_ledger_id AND l.customer_id=h.customer_id AND l.change_type='CONSUMPTION' SET f.wallet_hold_id=h.id,f.status='SETTLED' WHERE h.id=? AND f.direction='RECEIVABLE' AND f.status='AVAILABLE' AND f.amount=-l.amount",
hold.holdId());
}
return hold;
Long ledgerId = "FREEZE".equals(command.operation()) ? hold.freezeLedgerId() : hold.actionLedgerId();
return new ExecutionResult(hold.status(), "SETTLE_ACTUAL".equals(command.operation()) ? command.amount() : hold.amount(),
String.valueOf(hold.holdId()), ledgerId == null ? null : String.valueOf(ledgerId));
}
private WalletCommandRequestedV1 validate(EventEnvelope envelope) {
@@ -118,14 +130,22 @@ public class WalletCommandEventService {
String operation = value.operation() == null ? "" : value.operation().trim().toUpperCase(Locale.ROOT);
if (!OPERATIONS.contains(operation) || value.customerId() <= 0 || blank(value.businessType())
|| blank(value.businessNo()) || blank(value.idempotencyKey())
|| ("FREEZE".equals(operation) && (value.amount() == null || value.amount().signum() <= 0))) {
|| (Set.of("FREEZE", "SETTLE_ACTUAL", "REFUND").contains(operation)
&& (value.amount() == null || value.amount().signum() <= 0 || value.amount().scale() > 2))) {
throw new FinanceEventException("FIN-EVT-001", "资金指令字段无效");
}
if ("REFUND".equals(operation)) {
if (blank(value.originalLedgerId()) || Long.parseLong(value.originalLedgerId()) <= 0 || blank(value.remark())) {
throw new FinanceEventException("FIN-EVT-001", "退款必须关联原扣款并填写原因");
}
} else if (value.originalLedgerId() != null) {
throw new FinanceEventException("FIN-EVT-001", "非退款指令不能指定原扣款");
}
if (!String.valueOf(value.customerId()).equals(envelope.tenantId())) {
throw new FinanceEventException("FIN-EVT-007", "资金指令客户归属不一致");
}
return new WalletCommandRequestedV1(operation, value.customerId(), value.businessType(), value.businessNo(),
value.amount(), value.remark(), value.idempotencyKey(), value.requestedAt());
value.amount(), value.remark(), value.idempotencyKey(), value.requestedAt(), value.originalLedgerId());
} catch (FinanceEventException exception) { throw exception; }
catch (Exception exception) { throw new FinanceEventException("FIN-EVT-001", "资金指令载荷无法解析"); }
}
@@ -159,9 +179,10 @@ public class WalletCommandEventService {
return count != null && count > 0;
}
private WalletCommandCompletedV1 completed(String eventId, WalletCommandRequestedV1 command, String result,
String holdStatus, BigDecimal amount, String errorCode, String errorMessage) {
String holdStatus, BigDecimal amount, String errorCode, String errorMessage,
String holdId, String ledgerId) {
return new WalletCommandCompletedV1(eventId, command.operation(), command.customerId(), command.businessType(),
command.businessNo(), result, holdStatus, amount, errorCode, errorMessage, Instant.now());
command.businessNo(), result, holdStatus, amount, errorCode, errorMessage, Instant.now(), holdId, ledgerId);
}
private String json(Object value) {
try { return objectMapper.writeValueAsString(value); }
@@ -45,11 +45,11 @@ class BusinessFeeSourceEventServiceTest {
when(jdbc.queryForList(startsWith("SELECT payload_hash,status,result_resource_id"),
eq("LASTLEG"), eq(event.eventId()))).thenReturn(List.of());
when(jdbc.queryForList(startsWith("SELECT id,source_hash,status FROM fin_fee_source"),
eq("LASTLEG"), eq("OVERSEAS_PROCUREMENT_FEE"), eq(701L), eq(1))).thenReturn(List.of());
eq("LASTLEG"), eq("OVERSEAS_WAREHOUSE_FEE"), eq(701L), eq(1))).thenReturn(List.of());
when(jdbc.queryForObject(startsWith("SELECT COUNT(*) FROM fin_fee_source f WHERE f.source_system=?"),
eq(Integer.class), eq("LASTLEG"), eq("OVERSEAS_PROCUREMENT_FEE"), eq(701L))).thenReturn(0);
eq(Integer.class), eq("LASTLEG"), eq("OVERSEAS_WAREHOUSE_FEE"), eq(701L))).thenReturn(0);
when(jdbc.queryForObject(startsWith("SELECT id FROM fin_fee_source"), eq(Long.class),
eq("LASTLEG"), eq("OVERSEAS_PROCUREMENT_FEE"), eq(701L), eq(1))).thenReturn(901L);
eq("LASTLEG"), eq("OVERSEAS_WAREHOUSE_FEE"), eq(701L), eq(1))).thenReturn(901L);
assertThat(service.consume(event).eventId()).isEqualTo(event.eventId());
@@ -65,21 +65,21 @@ class BusinessFeeSourceEventServiceTest {
private EventEnvelope eventWithoutInbound() {
BusinessFeeSourceChangedV1 unsigned = new BusinessFeeSourceChangedV1(null, "LASTLEG",
"OVERSEAS_PROCUREMENT_FEE", "701", 1, "10001", "客户A", "PO-US-001",
"OVERSEAS_PROCUREMENT", "801", "PO-US-001", null, null, null, null, null,
"OVERSEAS_WAREHOUSE_FEE", "701", 1, "10001", "客户A", "PO-US-001",
"WAREHOUSE_SERVICE", "801", "PO-US-001", null, null, null, null, null,
null, "91", "PROCUREMENT_SERVICE", "采购服务费", "RECEIVABLE", null, null,
null, null, null, null, null, List.of(), LocalDate.of(2026, 9, 2), "CNY",
new BigDecimal("120.00"), "CNY", new BigDecimal("120.00"), BigDecimal.ONE,
"2026-09", null, null, null, null, null, "APPROVED", "PUBLISHED", "ACTIVE", null);
"2026-09", null, null, null, null, null, "APPROVED", "PUBLISHED", "ACTIVE", null, null);
String sourceHash = EventPayloadHash.sha256(
EventPayloadCanonicalizer.canonicalize(json.valueToTree(unsigned)));
BusinessFeeSourceChangedV1 payload = new BusinessFeeSourceChangedV1("PUBLISHED", "LASTLEG",
"OVERSEAS_PROCUREMENT_FEE", "701", 1, "10001", "客户A", "PO-US-001",
"OVERSEAS_PROCUREMENT", "801", "PO-US-001", null, null, null, null, null,
"OVERSEAS_WAREHOUSE_FEE", "701", 1, "10001", "客户A", "PO-US-001",
"WAREHOUSE_SERVICE", "801", "PO-US-001", null, null, null, null, null,
null, "91", "PROCUREMENT_SERVICE", "采购服务费", "RECEIVABLE", null, null,
null, null, null, null, null, List.of(), LocalDate.of(2026, 9, 2), "CNY",
new BigDecimal("120.00"), "CNY", new BigDecimal("120.00"), BigDecimal.ONE,
"2026-09", null, null, null, null, null, "APPROVED", "PUBLISHED", "ACTIVE", sourceHash);
"2026-09", null, null, null, null, null, "APPROVED", "PUBLISHED", "ACTIVE", sourceHash, null);
JsonNode node = json.valueToTree(payload);
String payloadHash = EventPayloadHash.sha256(EventPayloadCanonicalizer.canonicalize(node));
return new EventEnvelope("123e4567-e89b-12d3-a456-426614174701",
@@ -237,4 +237,53 @@ class BusinessFeeSourceEventServiceTest {
verify(jdbc, never()).update(startsWith("INSERT INTO fin_cost"), any(Object[].class));
verify(jdbc, never()).update(startsWith("UPDATE fin_cost"), any(Object[].class));
}
@Test
void procurementWithoutConsumptionReferenceNeverEntersReceivablePool() {
EventEnvelope event = procurementEvent(false);
assertThatThrownBy(() -> service.consume(event)).hasMessageContaining("必须引用成功实扣");
noFinancialWrites();
}
@Test
void settledProcurementUsesVerifiedActualConsumptionAndNeverOriginalEstimate() {
EventEnvelope event = procurementEvent(true);
when(jdbc.queryForObject(startsWith("SELECT id FROM fin_fee_source"), eq(Long.class),
eq("LASTLEG"), eq("OVERSEAS_PROCUREMENT_FEE"), eq(701L), eq(1))).thenReturn(901L);
when(jdbc.queryForList(startsWith("SELECT l.amount,c.result_json"), eq("command-1"), eq(9L), eq(72L),
eq(10001L), eq("PROCUREMENT_FEE"), eq("PO-US-001"))).thenReturn(List.of(Map.of(
"amount", new BigDecimal("-120.00"), "result_json", """
{"result":"SUCCEEDED","operation":"SETTLE_ACTUAL","commandEventId":"command-1",
"walletHoldId":"9","walletLedgerId":"72","customerId":10001,
"businessType":"PROCUREMENT_FEE","businessNo":"PO-US-001","amount":120.00}
""")));
service.consume(event);
verify(jdbc).update(startsWith("UPDATE fin_fee_source SET wallet_hold_id="), eq(9L), eq(901L), eq(10001L));
verify(jdbc, never()).update(startsWith("UPDATE fin_fee_source f JOIN fin_wallet_hold"), any(Object[].class));
}
@Test
void incorrectOrCrossCustomerConsumptionIsRejectedInsteadOfBecomingAvailable() {
EventEnvelope event = procurementEvent(true);
when(jdbc.queryForObject(startsWith("SELECT id FROM fin_fee_source"), eq(Long.class),
eq("LASTLEG"), eq("OVERSEAS_PROCUREMENT_FEE"), eq(701L), eq(1))).thenReturn(901L);
assertThatThrownBy(() -> service.consume(event)).hasMessageContaining("不匹配");
verify(jdbc, never()).update(startsWith("UPDATE fin_fee_source SET wallet_hold_id="), any(Object[].class));
}
private EventEnvelope procurementEvent(boolean reference) {
EventEnvelope base = eventWithoutInbound();
ObjectNode payload = (ObjectNode) base.payload().deepCopy();
payload.put("sourceType", "OVERSEAS_PROCUREMENT_FEE");
payload.put("businessType", "PROCUREMENT_FEE");
if (reference) {
payload.putObject("walletSettlement").put("commandEventId", "command-1").put("holdId", "9").put("ledgerId", "72");
}
payload.putNull("action"); payload.putNull("sourceHash");
payload.put("sourceHash", EventPayloadHash.sha256(EventPayloadCanonicalizer.canonicalize(payload)));
payload.put("action", "PUBLISHED");
return new EventEnvelope(base.eventId(), base.eventType(), base.eventVersion(), base.occurredAt(), base.tenantId(),
base.aggregateType(), base.aggregateId(), base.aggregateVersion(), null, base.traceId(), base.correlationId(), null,
payload, EventPayloadHash.sha256(EventPayloadCanonicalizer.canonicalize(payload)));
}
}
@@ -101,6 +101,38 @@ class WalletCommandEventServiceTest {
verify(jdbc, never()).update(startsWith("INSERT INTO fin_wallet_event_outbox"), any(Object[].class));
}
@Test
void actualSettlementReportsActualChargeInsteadOfOriginalEstimate() throws Exception {
EventEnvelope event = envelope("SETTLE_ACTUAL", 31L, new BigDecimal("60.00"));
when(jdbc.queryForList(startsWith("SELECT payload_hash"), eq(String.class), eq(event.eventId())))
.thenReturn(List.of(event.payloadHash()));
when(jdbc.queryForObject(startsWith("SELECT COUNT(*)"), eq(Integer.class), anyString())).thenReturn(0);
when(wallet.settleActual(eq(31L), eq("OVERSEAS_PROCUREMENT_FEE"), eq("PO-1"),
eq("freeze-procurement-1"), argThat((BigDecimal amount) -> amount.compareTo(new BigDecimal("60.00")) == 0), any())).thenReturn(
new WalletHold(9L, 31L, "OVERSEAS_PROCUREMENT_FEE", "PO-1", new BigDecimal("100.00"),
new BigDecimal("100.00"), BigDecimal.ZERO, "SETTLED", 71L, 72L, null, null, null));
service.consume(event);
var resultJson = org.mockito.ArgumentCaptor.forClass(String.class);
verify(jdbc).update(startsWith("UPDATE fin_wallet_command_inbox SET status="), eq("SUCCEEDED"),
resultJson.capture(), eq(event.eventId()));
JsonNode result = mapper.readTree(resultJson.getValue());
assertThat(result.path("amount").decimalValue()).isEqualByComparingTo("60.00");
assertThat(result.path("holdStatus").asText()).isEqualTo("SETTLED");
assertThat(result.path("walletHoldId").asText()).isEqualTo("9");
assertThat(result.path("walletLedgerId").asText()).isEqualTo("72");
verify(jdbc).update(contains("f.amount=-l.amount"), eq(9L));
verify(wallet, never()).release(anyLong(), anyString(), anyString(), anyString(), any());
}
@Test
void actualSettlementRejectsZeroAndMissingAmountsBeforeOpeningTransaction() {
for (BigDecimal amount : new BigDecimal[]{null, BigDecimal.ZERO, new BigDecimal("0.001")}) {
assertThatThrownBy(() -> service.consume(envelope("SETTLE_ACTUAL", 31L, amount)))
.isInstanceOf(FinanceEventException.class);
}
verifyNoInteractions(jdbc, wallet, transactions);
}
@Test
void losingInboxInsertMustRecheckThePersistedHash() {
EventEnvelope event = envelope("FREEZE", 31L, new BigDecimal("10.00"));
@@ -133,9 +165,44 @@ class WalletCommandEventServiceTest {
}
private EventEnvelope envelope(String operation, long customerId, BigDecimal amount) {
return envelope(operation, customerId, amount, null);
}
@Test
void refundRequiresOriginalConsumptionBeforeAnyWalletCall() {
assertThatThrownBy(() -> service.consume(envelope("REFUND", 31L, BigDecimal.TEN)))
.isInstanceOf(FinanceEventException.class);
verifyNoInteractions(jdbc, wallet);
}
@Test
void refundHasItsOwnLedgerReferenceAndNeverPretendsToSettleAHold() throws Exception {
EventEnvelope event = envelope("REFUND", 31L, BigDecimal.TEN, "72");
when(jdbc.queryForList(startsWith("SELECT payload_hash"), eq(String.class), eq(event.eventId())))
.thenReturn(List.of(event.payloadHash()));
when(jdbc.queryForObject(startsWith("SELECT COUNT(*)"), eq(Integer.class), anyString())).thenReturn(0);
var refunded = new com.baiyue.finance.dto.FinanceWalletDtos.WalletLedgerEntry(73L, "AC-TEST", "REFUND",
BigDecimal.TEN, BigDecimal.TEN, BigDecimal.ZERO, BigDecimal.TEN, BigDecimal.ZERO, BigDecimal.ZERO,
BigDecimal.ZERO, null, "BUSINESS_REFUND", "PO-1", java.time.LocalDate.now(), null,
"AC-ORIGINAL", "业务系统", "采购快递费", null);
when(wallet.refundConsumption(eq(31L), eq(72L), eq("PO-1"), eq("freeze-procurement-1"),
any(), eq(0L), anyString(), anyString())).thenReturn(refunded);
service.consume(event);
var capture = org.mockito.ArgumentCaptor.forClass(String.class);
verify(jdbc).update(startsWith("UPDATE fin_wallet_command_inbox SET status="), eq("SUCCEEDED"),
capture.capture(), eq(event.eventId()));
JsonNode result = mapper.readTree(capture.getValue());
assertThat(result.path("walletLedgerId").asText()).isEqualTo("73");
assertThat(result.path("walletHoldId").isNull()).isTrue();
assertThat(result.path("holdStatus").asText()).isEqualTo("REFUNDED");
verify(wallet, never()).settle(anyLong(), anyString(), anyString(), anyString(), any());
verify(jdbc, never()).update(startsWith("UPDATE fin_fee_source"), any(Object[].class));
}
private EventEnvelope envelope(String operation, long customerId, BigDecimal amount, String originalLedgerId) {
WalletCommandRequestedV1 command = new WalletCommandRequestedV1(operation, customerId,
"OVERSEAS_PROCUREMENT_FEE", "PO-1", amount, "采购快递费",
"freeze-procurement-1", Instant.parse("2026-09-05T01:00:00Z"));
"freeze-procurement-1", Instant.parse("2026-09-05T01:00:00Z"), originalLedgerId);
JsonNode payload = mapper.valueToTree(command);
return new EventEnvelope(UUID.randomUUID().toString(), EventTypes.WALLET_COMMAND_REQUESTED,
WalletCommandRequestedV1.VERSION, Instant.parse("2026-09-05T01:00:00Z"), String.valueOf(customerId), "WALLET_HOLD", "PO-1", 1,
@@ -190,7 +190,7 @@ class WalletCommandTransactionTest {
private EventEnvelope event(String id, String amount) {
var command = new WalletCommandRequestedV1("FREEZE", 31L, "OVERSEAS_PROCUREMENT_FEE", "PO-1",
new BigDecimal(amount), "fee", "freeze-1", Instant.parse("2026-09-05T01:00:00Z"));
new BigDecimal(amount), "fee", "freeze-1", Instant.parse("2026-09-05T01:00:00Z"), null);
var payload = mapper.valueToTree(command);
return new EventEnvelope(id, EventTypes.WALLET_COMMAND_REQUESTED, WalletCommandRequestedV1.VERSION,
Instant.now(), "31", "WALLET_HOLD", "PO-1", 1,
@@ -0,0 +1,91 @@
package com.baiyue.finance.service;
import com.baiyue.finance.client.FinanceFileClient;
import com.baiyue.finance.dto.FinanceWalletDtos.WalletAccount;
import com.baiyue.finance.dto.FinanceWalletDtos.WalletHold;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.jupiter.api.Test;
import org.springframework.jdbc.core.JdbcTemplate;
import java.math.BigDecimal;
import java.time.LocalDate;
import static org.assertj.core.api.Assertions.*;
import static org.mockito.Mockito.mock;
class ProcurementActualSettlementTest {
private final FinanceWalletService service = new FinanceWalletService(mock(JdbcTemplate.class),
new ObjectMapper().findAndRegisterModules(), mock(FinanceFileClient.class),
mock(FinanceDocumentNumberGenerator.class), "token", "", "test", "test");
@Test
void smallerActualChargeReleasesRemainderAndKeepsOtherReservations() {
WalletAccount before = account("200", "150", "0", "0", "0", null);
WalletAccount after = service.settleActualAccount(before, hold("100", "100", "0"), n("60"));
assertThat(after.actualBalance()).isEqualByComparingTo("140");
assertThat(after.frozenBalance()).isEqualByComparingTo("50");
assertThat(after.availableBalance()).isEqualByComparingTo("90");
}
@Test
void excessUsesAvailableCashThenActiveCreditWithoutTouchingOtherHolds() {
WalletAccount before = account("120", "130", "100", "0", "30", LocalDate.now().plusDays(1));
WalletAccount after = service.settleActualAccount(before, hold("100", "70", "30"), n("150"));
assertThat(after.actualBalance()).isEqualByComparingTo("30");
assertThat(after.creditUsed()).isEqualByComparingTo("60");
assertThat(after.frozenBalance()).isEqualByComparingTo("30");
assertThat(after.creditFrozen()).isZero();
assertThat(after.availableBalance()).isEqualByComparingTo("40");
}
@Test
void insufficientExcessRejectsWithoutChangingOriginalAccount() {
WalletAccount before = account("120", "100", "0", "0", "0", null);
assertThatThrownBy(() -> service.settleActualAccount(before, hold("100", "100", "0"), n("120.01")))
.isInstanceOf(FinanceEventException.class)
.extracting(e -> ((FinanceEventException) e).code()).isEqualTo("FIN-WALLET-INSUFFICIENT");
assertThat(before.actualBalance()).isEqualByComparingTo("120");
assertThat(before.frozenBalance()).isEqualByComparingTo("100");
}
@Test
void partialChargeUsesReservedCashBeforeCredit() {
WalletAccount before = account("70", "100", "100", "0", "30", LocalDate.now().plusDays(1));
WalletAccount after = service.settleActualAccount(before, hold("100", "70", "30"), n("60"));
assertThat(after.actualBalance()).isEqualByComparingTo("10");
assertThat(after.creditUsed()).isZero();
assertThat(after.creditFrozen()).isZero();
assertThat(after.frozenBalance()).isZero();
}
@Test
void expiredCreditAllowsOriginalReservationButNeverNewCredit() {
WalletAccount before = account("20", "100", "100", "0", "80", LocalDate.now().minusDays(1));
WalletAccount after = service.settleActualAccount(before, hold("100", "20", "80"), n("100"));
assertThat(after.actualBalance()).isEqualByComparingTo("-80");
assertThat(after.creditUsed()).isZero();
assertThat(after.frozenBalance()).isZero();
assertThatThrownBy(() -> service.settleActualAccount(before, hold("100", "20", "80"), n("100.01")))
.isInstanceOf(FinanceEventException.class);
}
@Test
void invalidActualAmountMustUseReleaseOrCorrectPrecision() {
WalletAccount before = account("200", "100", "0", "0", "0", null);
for (String value : new String[]{"0", "-1", "0.001"}) {
assertThatThrownBy(() -> service.settleActualAccount(before, hold("100", "100", "0"), n(value)))
.isInstanceOf(FinanceEventException.class);
}
}
private WalletAccount account(String actual, String frozen, String limit, String used, String creditFrozen, LocalDate expiry) {
return service.accountState(n(actual), n(frozen), n(limit), n(used), n(creditFrozen), expiry, 1);
}
private WalletHold hold(String amount, String cash, String credit) {
return new WalletHold(1L, 9L, "PROCUREMENT_FEE", "PF-TEST", n(amount), n(cash), n(credit),
"FROZEN", 1L, null, null, null, null);
}
private static BigDecimal n(String value) { return new BigDecimal(value); }
}
@@ -0,0 +1,200 @@
package com.baiyue.finance.service;
import com.baiyue.finance.client.FinanceFileClient;
import com.baiyue.finance.dto.FinanceWalletDtos.WalletHold;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.h2.jdbcx.JdbcDataSource;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.dao.TransientDataAccessResourceException;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.transaction.support.TransactionTemplate;
import java.math.BigDecimal;
import java.util.UUID;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicInteger;
import static org.assertj.core.api.Assertions.*;
import static org.mockito.ArgumentMatchers.*;
import static org.mockito.Mockito.*;
/** Executes the real wallet service against transactional JDBC; no mocked money mutations. */
class ProcurementSettlementTransactionTest {
private JdbcTemplate jdbc;
private TransactionTemplate tx;
private FinanceWalletService wallet;
@BeforeEach
void setup() {
JdbcDataSource source = new JdbcDataSource();
source.setURL("jdbc:h2:mem:" + UUID.randomUUID() + ";MODE=MySQL;DATABASE_TO_LOWER=TRUE;DB_CLOSE_DELAY=-1;LOCK_TIMEOUT=5000");
jdbc = spy(new JdbcTemplate(source));
tx = new TransactionTemplate(new DataSourceTransactionManager(source));
jdbc.execute("CREATE TABLE fin_wallet_account(customer_id BIGINT PRIMARY KEY,currency_code VARCHAR(3),actual_balance DECIMAL(18,2),frozen_balance DECIMAL(18,2),available_balance DECIMAL(18,2),credit_limit DECIMAL(18,2),credit_used DECIMAL(18,2),credit_frozen DECIMAL(18,2),credit_expires_on DATE,version INT,created_by BIGINT,updated_by BIGINT,updated_at TIMESTAMP)");
jdbc.execute("CREATE TABLE fin_wallet_hold(id BIGINT AUTO_INCREMENT PRIMARY KEY,customer_id BIGINT,business_type VARCHAR(32),business_no VARCHAR(128),amount DECIMAL(18,2),actual_frozen_amount DECIMAL(18,2),credit_frozen_amount DECIMAL(18,2),status VARCHAR(32),freeze_ledger_id BIGINT,action_ledger_id BIGINT,created_at TIMESTAMP,completed_at TIMESTAMP,remark VARCHAR(500),UNIQUE(customer_id,business_type,business_no))");
jdbc.execute("CREATE TABLE fin_idempotency_record(tenant_id BIGINT,operator_id BIGINT,operation VARCHAR(64),idempotency_key VARCHAR(128),request_hash VARCHAR(128),status VARCHAR(32),result_resource_id BIGINT,error_code VARCHAR(128),UNIQUE(tenant_id,operator_id,operation,idempotency_key))");
jdbc.execute("CREATE TABLE fin_wallet_ledger(id BIGINT AUTO_INCREMENT PRIMARY KEY,customer_id BIGINT,business_no VARCHAR(128),change_type VARCHAR(32),amount DECIMAL(18,2),actual_balance_after DECIMAL(18,2),frozen_balance_after DECIMAL(18,2),available_balance_after DECIMAL(18,2),credit_limit_after DECIMAL(18,2),credit_used_after DECIMAL(18,2),available_credit_after DECIMAL(18,2),credit_expires_on_after DATE,source_type VARCHAR(32),source_no VARCHAR(128),occurred_date DATE,payment_method VARCHAR(32),reference_no VARCHAR(128),operator_id BIGINT,operator_name VARCHAR(128),remark VARCHAR(500),created_at TIMESTAMP)");
jdbc.execute("CREATE TABLE fin_audit_log(tenant_id BIGINT,resource_type VARCHAR(64),resource_id BIGINT,action VARCHAR(64),reason VARCHAR(500),before_data TEXT,after_data TEXT,operator_id BIGINT,operator_name_snapshot VARCHAR(128),request_id VARCHAR(128),trace_id VARCHAR(128))");
jdbc.update("INSERT INTO fin_wallet_account VALUES(9,'CNY',200,100,100,0,0,0,NULL,0,0,0,CURRENT_TIMESTAMP)");
jdbc.update("INSERT INTO fin_wallet_hold(id,customer_id,business_type,business_no,amount,actual_frozen_amount,credit_frozen_amount,status) VALUES(1,9,'PROCUREMENT_FEE','PF-1',100,100,0,'FROZEN')");
FinanceDocumentNumberGenerator numbers = mock(FinanceDocumentNumberGenerator.class);
AtomicInteger sequence = new AtomicInteger();
when(numbers.next("AC")).thenAnswer(i -> "AC-TEST-" + sequence.incrementAndGet());
wallet = new FinanceWalletService(jdbc, new ObjectMapper().findAndRegisterModules(),
mock(FinanceFileClient.class), numbers, "token", "", "test", "test");
}
@Test
void partialSettlementKeepsEstimateAndRecordsActualExactlyOnce() {
WalletHold first = settle("request-1", "60");
WalletHold replay = settle("request-1", "60");
assertThat(replay.actionLedgerId()).isEqualTo(first.actionLedgerId());
assertThat(first.amount()).isEqualByComparingTo("100");
assertThat(first.account().actualBalance()).isEqualByComparingTo("140");
assertThat(first.account().frozenBalance()).isZero();
assertThat(jdbc.queryForObject("SELECT amount FROM fin_wallet_ledger", BigDecimal.class)).isEqualByComparingTo("-60");
assertThatThrownBy(() -> settle("different-request", "60")).isInstanceOf(FinanceEventException.class);
assertThat(jdbc.queryForObject("SELECT COUNT(*) FROM fin_wallet_ledger", Integer.class)).isEqualTo(1);
}
@Test
void sameKeyWithDifferentAmountCannotChangeCharge() {
settle("request-1", "60");
assertThatThrownBy(() -> settle("request-1", "70")).isInstanceOf(FinanceEventException.class)
.extracting(e -> ((FinanceEventException) e).code()).isEqualTo("FIN-IDEMPOTENCY-CONFLICT");
assertThat(wallet.account(9).actualBalance()).isEqualByComparingTo("140");
}
@Test
void insufficientDifferenceLeavesOriginalHoldAndAccountUntouched() {
assertThatThrownBy(() -> settle("request-1", "201")).isInstanceOf(FinanceEventException.class);
assertUntouched();
assertThat(jdbc.queryForObject("SELECT COUNT(*) FROM fin_idempotency_record", Integer.class)).isZero();
}
@Test
void auditFailureRollsBackDebitLedgerHoldAndIdempotencyReservation() {
doThrow(new TransientDataAccessResourceException("audit storage unavailable"))
.when(jdbc).update(startsWith("INSERT INTO fin_audit_log"), any(Object[].class));
assertThatThrownBy(() -> settle("request-1", "150"))
.isInstanceOf(TransientDataAccessResourceException.class);
assertUntouched();
assertThat(jdbc.queryForObject("SELECT COUNT(*) FROM fin_idempotency_record", Integer.class)).isZero();
}
@Test
void concurrentDifferentRequestsCannotSettleTheSameGoodsTwice() throws Exception {
ExecutorService executor = Executors.newFixedThreadPool(2);
CountDownLatch start = new CountDownLatch(1);
try {
Future<Boolean> one = executor.submit(() -> attempt(start, "one"));
Future<Boolean> two = executor.submit(() -> attempt(start, "two"));
start.countDown();
assertThat((one.get(10, TimeUnit.SECONDS) ? 1 : 0) + (two.get(10, TimeUnit.SECONDS) ? 1 : 0)).isEqualTo(1);
assertThat(wallet.account(9).actualBalance()).isEqualByComparingTo("50");
assertThat(jdbc.queryForObject("SELECT COUNT(*) FROM fin_wallet_ledger", Integer.class)).isEqualTo(1);
} finally {
executor.shutdownNow();
assertThat(executor.awaitTermination(5, TimeUnit.SECONDS)).isTrue();
}
}
private boolean attempt(CountDownLatch start, String key) throws InterruptedException {
if (!start.await(5, TimeUnit.SECONDS)) throw new AssertionError("start timeout");
try { settle(key, "150"); return true; }
catch (FinanceEventException expected) {
assertThat(expected.code()).isEqualTo("FIN-WALLET-HOLD-409");
return false;
}
}
@Test
void refundsAreBoundedByOriginalConsumptionAndCannotReplayWithNewKey() {
WalletHold settled = settle("settle", "60");
var refund = tx.execute(s -> wallet.refundConsumption(9, settled.actionLedgerId(), "RF-1", "refund-1",
new BigDecimal("40"), 7, "finance", "confirmed correction"));
var replay = tx.execute(s -> wallet.refundConsumption(9, settled.actionLedgerId(), "RF-1", "new-key",
new BigDecimal("40"), 7, "finance", "confirmed correction"));
assertThat(replay.ledgerId()).isEqualTo(refund.ledgerId());
assertThat(wallet.account(9).actualBalance()).isEqualByComparingTo("180");
assertThatThrownBy(() -> tx.execute(s -> wallet.refundConsumption(9, settled.actionLedgerId(), "RF-2", "refund-2",
new BigDecimal("20.01"), 7, "finance", "too much")))
.isInstanceOf(FinanceEventException.class)
.extracting(e -> ((FinanceEventException) e).code()).isEqualTo("FIN-WALLET-REFUND-EXCEEDED");
tx.execute(s -> wallet.refundConsumption(9, settled.actionLedgerId(), "RF-2", "refund-2",
new BigDecimal("20"), 7, "finance", "remaining refund"));
assertThat(wallet.account(9).actualBalance()).isEqualByComparingTo("200");
assertThat(jdbc.queryForObject("SELECT status FROM fin_wallet_hold", String.class)).isEqualTo("SETTLED");
assertThat(jdbc.queryForObject("SELECT SUM(amount) FROM fin_wallet_ledger WHERE source_type='BUSINESS_REFUND'", BigDecimal.class))
.isEqualByComparingTo("60");
}
@Test
void refundCannotReferenceAnotherCustomerOrAnUnsettledReservation() {
WalletHold settled = settle("settle", "60");
assertThatThrownBy(() -> tx.execute(s -> wallet.refundConsumption(10, settled.actionLedgerId(), "RF-1", "refund-1",
BigDecimal.ONE, 7, "finance", "wrong customer"))).isInstanceOf(FinanceEventException.class);
assertThatThrownBy(() -> tx.execute(s -> wallet.refundConsumption(9, settled.actionLedgerId(), "RF-1", "refund-1",
BigDecimal.ZERO, 7, "finance", "zero refund"))).isInstanceOf(FinanceEventException.class);
assertThat(wallet.account(9).actualBalance()).isEqualByComparingTo("140");
}
@Test
void refundFailureRollsBackBalanceAndCanRetryOriginalRequest() {
WalletHold settled = settle("settle", "60");
doThrow(new TransientDataAccessResourceException("audit unavailable"))
.when(jdbc).update(startsWith("INSERT INTO fin_audit_log"), any(Object[].class));
assertThatThrownBy(() -> tx.execute(s -> wallet.refundConsumption(9, settled.actionLedgerId(), "RF-1", "refund-1",
new BigDecimal("20"), 7, "finance", "correction"))).isInstanceOf(TransientDataAccessResourceException.class);
assertThat(wallet.account(9).actualBalance()).isEqualByComparingTo("140");
assertThat(jdbc.queryForObject("SELECT COUNT(*) FROM fin_wallet_ledger WHERE change_type='REFUND'", Integer.class)).isZero();
doCallRealMethod().when(jdbc).update(startsWith("INSERT INTO fin_audit_log"), any(Object[].class));
tx.execute(s -> wallet.refundConsumption(9, settled.actionLedgerId(), "RF-1", "refund-1",
new BigDecimal("20"), 7, "finance", "correction"));
assertThat(wallet.account(9).actualBalance()).isEqualByComparingTo("160");
}
private WalletHold settle(String key, String amount) {
return tx.execute(s -> wallet.settleActual(9, "PROCUREMENT_FEE", "PF-1", key, new BigDecimal(amount), "actual freight"));
}
@Test
void concurrentRefundsCannotExceedTheOriginalConsumption() throws Exception {
WalletHold original = settle("settle", "60");
ExecutorService executor = Executors.newFixedThreadPool(2);
CountDownLatch start = new CountDownLatch(1);
try {
Future<Boolean> one = executor.submit(() -> refundAttempt(start, original.actionLedgerId(), "RF-A"));
Future<Boolean> two = executor.submit(() -> refundAttempt(start, original.actionLedgerId(), "RF-B"));
start.countDown();
assertThat((one.get(10, TimeUnit.SECONDS) ? 1 : 0) + (two.get(10, TimeUnit.SECONDS) ? 1 : 0)).isEqualTo(1);
assertThat(wallet.account(9).actualBalance()).isEqualByComparingTo("180");
assertThat(jdbc.queryForObject("SELECT SUM(amount) FROM fin_wallet_ledger WHERE change_type='REFUND'", BigDecimal.class))
.isEqualByComparingTo("40");
} finally {
executor.shutdownNow();
assertThat(executor.awaitTermination(5, TimeUnit.SECONDS)).isTrue();
}
}
private boolean refundAttempt(CountDownLatch start, long originalId, String number) throws InterruptedException {
if (!start.await(5, TimeUnit.SECONDS)) throw new AssertionError("start timeout");
try {
tx.execute(s -> wallet.refundConsumption(9, originalId, number, number, new BigDecimal("40"),
7, "finance", "correction"));
return true;
} catch (FinanceEventException expected) {
assertThat(expected.code()).isEqualTo("FIN-WALLET-REFUND-EXCEEDED");
return false;
}
}
private void assertUntouched() {
assertThat(wallet.account(9).actualBalance()).isEqualByComparingTo("200");
assertThat(wallet.account(9).frozenBalance()).isEqualByComparingTo("100");
assertThat(jdbc.queryForObject("SELECT status FROM fin_wallet_hold", String.class)).isEqualTo("FROZEN");
assertThat(jdbc.queryForObject("SELECT COUNT(*) FROM fin_wallet_ledger", Integer.class)).isZero();
}
}
+12 -1
View File
@@ -1,5 +1,10 @@
# Firstleg Service 模块指引
## 数据库访问与中文注释约束
- 强制遵守根 `../AGENTS.md` 的“数据库访问与中文代码注释”全部规则:正常业务访问统一为 `Controller → Service → Repository → Mapper`,不得省略 Repository 或跨层直调;生产 SQL 由 Mapper 执行,Repository 不得直接使用 JdbcTemplate 或原生 JDBC。非 HTTP 入口从 Service 进入;无数据库模块不引入数据库访问。
- 每个手写方法及构造器须有简短中文说明;核心业务规则、复杂 SQL、事务、锁、幂等、并发及失败处理须补充适量中文注释,重点说明原因和边界。新增、修改方法立即执行,触及的存量代码同步整改。
## 职责与边界
- Mapper 统一显式使用 `@Mapper`,仅由 `BaiyueFirstlegApplication.java` 对 `com.baiyue.firstleg` 根包按 `annotationClass = Mapper.class` 扫描;禁止恢复业务子域 Mapper 包白名单。静态门禁见根 `scripts/mapper-scan-contract.mjs`,模块内编译门禁见 `MapperRegistrationArchitectureTest.java`、`BaiyueFirstlegApplicationContractTest.java`。
@@ -9,6 +14,10 @@
## 模块入口
预约日历到港只读:`portschedule/controller/PlatformPortScheduleController.java` 的 `/arrival-calendar`,沿 `PortScheduleService`、`PortScheduleMapper` 查询有效柜次及实际到港节点;合同 `src/main/resources/openapi/arrival-calendar-v1.yaml`,权限 `platform:appointment:list`。不在日历维护第二套船节点。
表内 `controller/`、`service/`、`mapper/`、`loading/` 等业务包路径相对 `src/main/java/com/baiyue/firstleg/`;`src/`、`docs/`、`scripts/` 和 `../` 开头路径相对本服务目录。裸文件名沿同一条目最近业务包定位,必要时在该包用 `rg --files` 查找,不从全仓猜路径。
事件人工重试:`controller/EventOperationsController.java` 提供内部 `/internal/firstleg/event-operations/{entryId}` 查询及 `/retry` 写入,只允许装柜完成与船节点事件;独立 `EVENT_OPERATIONS_TOKEN` 保护。原事件不可修改,DEAD→PENDING 与 `event_delivery_retry_audit` 同事务提交,脚本见根 `scripts/event-outbox-operations.mjs`。
柜次号与散货托盘码:`service/FirstlegDocumentNumberGenerator.java` 为新柜生成全局连续且不按日期重置的 `D0001`、`D0002` 柜次号;`service/LoadingPalletLabelService.java`、`mapper/LoadingPalletLabelMapper.java`、`controller/PlatformLoadingListController.java` 负责散货托盘码,契约为 `src/main/resources/openapi/loading-lists-v1.yaml` 的 `/pallet-labels/prepare` 与 `/pallet-labels/print`。仅在计划 `LOADING/COMPLETED` 且真实柜号有效时,为非一件代发的 FBA 明细按平台柜次号、FBA 地址内部编号、三位序号生成冻结标签;托盘码不依赖可跨提单复用的真实柜号,内部编号从 Warehouse 启用主数据读取,缺失或同柜重复时拒绝生成。重复生成须核对已有标签与明细一致,冲突直接拒绝。全部或按仓指定张数打印统一调用 Print `/internal/print/v1/pdfs/fba-pallet-labels`,模板 `FBA_PALLET_A4_LANDSCAPE_V1` 每托一页 297×210 mm,顶部为 SCK8 等 FBA 仓码,条码和底部文字为完整托盘号,与海外补打共用版式;装柜完成通过 `LoadingCompletedOutboxService.java` 传递来源托盘。
@@ -50,7 +59,9 @@
| 海外派送完成回写 | 同一内部事件入口、消费者 `service/OverseasDeliveryCompletedConsumer.java`;按来源入仓单、订单、入仓码和 FBA 仓校验后推进当前入仓单 `LOADED→DELIVERED`,同一 Order 全部有效入仓单完成后才经 `OrderFulfillmentCompletionClient` 推进 Order `COMPLETED` |
| 国内货柜履约海运订舱、资料/打印、关联候选与出仓前船期资料 | `oceanbooking/controller/PlatformOceanBookingController.java`、`oceanbooking/service/OceanBookingService.java`、`OceanBookingDocumentService.java`、`OceanBookingPrintService.java`、`oceanbooking/mapper/OceanBookingMapper.java`、`portschedule/controller/PlatformPortScheduleController.java`;文件经 `client/OceanBookingFileClient.java` 进入 File,关联候选 `/api/platform/v1/ocean-bookings/link-candidates`,契约 `src/main/resources/openapi/ocean-bookings-v1.yaml`,表结构见 `src/main/resources/db/phase3-ocean-booking-schema.sql` |
| 海外仓业务国内出仓后船节点定时查询 | `outbound/dispatch/service/OutboundDispatchService.java` 在确认出仓事务内幂等创建现有 `CarrierScheduleQuery`;编排与租约 `portschedule/service/CarrierScheduleQueryScheduler.java`,任务/十节点事实/异常事实/不可变 attempt `CarrierScheduleQueryService.java`,平台查询与人工补录入口 `PlatformCarrierScheduleQueryController.java` 的 `/{queryId}/manual-nodes`;停止只由实际 `EMPTY_RETURNED` 节点触发,不提供无节点停止入口;外部船司/轨迹调用经 `integration-service/`;标准见 `../../docs/海外仓业务/船节点标准化契约.md` |
| 目的港码头拖车与还空预警 | `terminaldrayage/controller/PlatformTerminalDrayageController.java`、`service/TerminalDrayageService.java`、`mapper/TerminalDrayageMapper.java`;货柜实际到港后引用 Warehouse `ACTIVE/TRUCKING/OVERSEAS` 海外车队供应商,依次选择车队、预约提柜、确认实际提柜,海外卸柜收货完成后确认还柜;服务端按卸柜完成时间加 72 小时返回报空预警,实际提柜和还柜通过现有 `CarrierScheduleQueryService` 推进 `PICKED_UP/EMPTY_RETURNED`,不复制船节点或车队主档。契约 `src/main/resources/openapi/terminal-drayage-v1.yaml`,基线 `src/main/resources/db/phase3-terminal-drayage-schema.sql` 邮件由 `terminaldrayage/service/TerminalDrayageMailService.java` 入队,`TerminalDrayageMailDispatcher.java` 顺序投递,模板与 SMTP 配置见 `docs/terminal-drayage-mail.md`;首次选队不发信,换队事务内生成取消与请求两封邮件。 |
| 已开船预约事项完整来源 | `portschedule/controller/InternalAppointmentWorkSourceController.java`、`service/AppointmentWorkSourceService.java`、`mapper/AppointmentWorkSourceMapper.java`;按完整来源版本游标提供所有实际开船或后续节点的有效货柜,保留无仓绑定与完成货柜;原始当地时间无时区时不得转UTC;契约 `src/main/resources/openapi/appointment-work-source-v1.yaml` |
| 直送目的仓实际卸货 | `terminaldrayage/controller/PlatformDirectDeliveryController.java`、`service/DirectDeliveryService.java`、`UnloadingEvidenceGuard.java`;按实装入仓来源逐票记录签收人与凭据,必须经 Lastleg 确认 DIRECT 路线且已提柜;不创建海外库存,全柜卸毕才可人工还空;契约 `src/main/resources/openapi/direct-delivery-v1.yaml`,基线 `src/main/resources/db/phase3-direct-delivery-schema.sql` |
| 目的港码头拖车与还空预警 | `terminaldrayage/controller/PlatformTerminalDrayageController.java`、`service/TerminalDrayageService.java`、`mapper/TerminalDrayageMapper.java`;货柜实际到港后引用 Warehouse `ACTIVE/TRUCKING/OVERSEAS` 海外车队供应商,依次选择车队、预约提柜、确认实际提柜,海外仓卸柜或全部直送目的仓实际卸货完成后确认还柜;服务端按卸柜完成时间加 72 小时返回报空预警,实际提柜和还柜通过现有 `CarrierScheduleQueryService` 推进 `PICKED_UP/EMPTY_RETURNED`,不复制船节点或车队主档。契约 `src/main/resources/openapi/terminal-drayage-v1.yaml`,基线 `src/main/resources/db/phase3-terminal-drayage-schema.sql` 邮件由 `terminaldrayage/service/TerminalDrayageMailService.java` 入队,`TerminalDrayageMailDispatcher.java` 顺序投递,模板与 SMTP 配置见 `docs/terminal-drayage-mail.md`;首次选队不发信,换队事务内生成取消与请求两封邮件。 |
| 船节点交接事件 | `portschedule/service/CarrierScheduleNodeOutboxService.java`;实际节点落库后按 `containerBookingId` 柜级发布 `FIRST_LEG_CONTAINER_SHIPPING_NODE_RECORDED` V1,信封固定使用 `tenantId=0` 平台技术范围且 Payload 不携带客户,复用 `LoadingCompletedOutboxRepository`/Relay 直投 Lastleg `/internal/lastleg/events`;消费见 `../lastleg-service/src/main/java/com/baiyue/lastleg/shipping/service/ContainerShippingNodeConsumer.java`,ACK/重试按 `../../docs/统一认证与服务通信契约.md` |
| Firstleg 业务单据编号 | `service/FirstlegDocumentNumberGenerator.java`;当前支持 `OB`、`TA`、`CB`、`CAB`、`LP` 前缀,按北京时间每日独立编号;具体业务归属以各调用服务为准 |
| 订舱级拖车与整柜出仓调度 | `controller/PlatformTruckAppointmentController.java` 的 `/candidates`、`service/TruckAppointmentService.java`、`repository/TruckAppointmentRepository.java`、`outbound/dispatch/controller/PlatformOutboundDispatchController.java`;拖车契约 `src/main/resources/openapi/truck-appointments-v1.yaml`。预约只绑定 `RELEASED` 订舱,候选排除缺提单/有效订舱文件或已有非终态预约的订舱;API 不含客户、柜次、装柜计划或真实柜号,每订舱最多一张有效预约,已有完成单不得重建收费;PDA 完成不推进拖车状态,全部要求货柜确认国内离仓后由 `TruckAppointmentCompletionService` 自动完成并经 `TruckAppointmentFeeService` 发布应付 |
@@ -248,3 +248,10 @@ PriceBookQueryMapper -> PriceBookQueryReader + PriceBookQueryRows
- 回滚仅恢复原三文件及消费者类型引用;不涉及 URI、权限、JSON、SQL、表结构、业务状态或环境配置。
- 只读模型仍保留原 Lombok 可变 Bean 形态以维持 MyBatis 映射行为;本轮不顺带改造成不可变领域对象。
- 验证结果:七段 `@Select` SQL 文本逐块完全一致;Node 合同 5/5;`test-compile` 成功;价格簿、ArchUnit、根扫描及三个消费者切片定向测试 78/78;Firstleg 聚合全量 878 个测试,0 失败、0 错误、3 跳过,构建成功。
## 预约工作集成时的精确边界核对
`PlatformContainerShippingNodeController` 归船节点切片,`sailingcalendar` 归订舱船期切片;不再误归共享技术层。既有海外事件适配、实装费用重算和渠道目录读取在 `reviewedClassDependencies` 按具体调用者、目标类型和理由登记,不放开整个切片。
现存全局 service 包同时承载暂扣、装柜费用和订舱文档编排,形成 loading.bridge.service、loading.service、oceanbooking.service、service 四包 SCC。它是尚未拆分的既有包级债务,本轮未宣称消除;`reviewedPackageCycles` 只冻结这一精确集合,新增节点或第二个环仍失败,价格簿查询与客户统计仍必须处于所有环之外。合同有新增消费者与新增环的负向测试。预约新增提供端通过原域适配接口消费事实,不增加该包环。
@@ -3,6 +3,7 @@
import fs from 'node:fs';
import path from 'node:path';
import process from 'node:process';
import { pathToFileURL } from 'node:url';
const moduleRoot = path.resolve(import.meta.dirname, '..');
const sourceRoots = {
@@ -15,8 +16,8 @@ const sliceRules = [
['customer-statistics', /(?:^|\.)(?:customerstatistics)(?:\.|$)/],
['pricebook-query', /(?:^|\.)(?:pricebookquery)(?:\.|$)/],
['finance-integration', /(?:InternalFinance|FinanceFeeSource|FinanceCostSnapshot|FeePaymentVoucher|FeePaymentSnapshot|ContainerFeeSourceSnapshot)/],
['shipping-nodes', /(?:CarrierScheduleQuery|CarrierScheduleNode|CarrierScheduleAdapter|CarrierScheduleAttempt|CarrierScheduleException)/],
['booking-customs-trucking', /(?:^|\.)(?:oceanbooking|customs|terminaldrayage)(?:\.|$)|(?:TruckAppointment|WarehouseSupplier|PortSchedule|DispatchGate)/],
['shipping-nodes', /(?:CarrierScheduleQuery|CarrierScheduleNode|CarrierScheduleAdapter|CarrierScheduleAttempt|CarrierScheduleException|ContainerShippingNode)/],
['booking-customs-trucking', /(?:^|\.)(?:oceanbooking|customs|terminaldrayage|sailingcalendar)(?:\.|$)|(?:TruckAppointment|WarehouseSupplier|PortSchedule|DispatchGate)/],
['outbound', /(?:^|\.)outbound(?:\.|$)|(?:OutboundDispatch|ContainerTransport|OverseasContainerEvent)/],
['split-loading', /(?:^|\.)(?:split|loading)(?:\.|$)|(?:Loading|SmartLoading|Container(?:Booking|Overview|Service|Dtos)|PdaPick)/],
['measurement-pricing', /(?:^|\.)pricing(?:\.|$)|(?:Measurement|MeasureReview|Mojia|Pricing|PriceBook|PriceChannel|PriceOrigin|PriceWarehouse|Fba|Dimension|FeeItem|MerchantInboundBilling|InboundFee)/],
@@ -261,14 +262,28 @@ function renderDot(report) {
return lines.join('\n');
}
function checkContract(report, contractPath) {
const absolute = path.resolve(process.cwd(), contractPath);
const contract = JSON.parse(fs.readFileSync(absolute, 'utf8'));
export function contractViolations(report, contract) {
const allowed = new Set(contract.allowedSliceEdges ?? []);
const actual = report.sliceEdges.map(edge => `${edge.source}->${edge.target}`);
const additions = actual.filter(edge => !allowed.has(edge));
const violations = additions.map(edge => `new slice dependency: ${edge}`);
const violations = [];
const cycles=new Set((contract.reviewedPackageCycles ?? []).filter(c=>c.reason?.trim()
&& c.packages?.length>1 && c.packages.every(p=>!p.includes('*'))).map(c=>[...c.packages].sort().join('|')));
for (const cycle of report.packageSccs ?? []) {
if (!cycles.has([...cycle].sort().join('|'))) violations.push(`unreviewed package cycle: ${cycle.join(' -> ')}`);
}
const reviewed = new Set();
for (const edge of contract.reviewedClassDependencies ?? []) {
if (!edge.source || !edge.target || !edge.reason?.trim() || /[*]/.test(edge.source + edge.target)) {
violations.push('reviewed dependency requires exact classes and a rationale');
continue;
}
reviewed.add(`${edge.source}->${edge.target}`);
}
const classesByName = new Map(report.classes.map(entry => [entry.fqcn, entry]));
for (const edge of report.classDependencies) {
const from=classesByName.get(edge.source)?.slice, to=classesByName.get(edge.target)?.slice;
if (from && to && from!==to && !allowed.has(`${from}->${to}`) && !reviewed.has(`${edge.source}->${edge.target}`))
violations.push(`unreviewed slice dependency: ${from}->${to}: ${edge.source}->${edge.target}`);
}
for (const [fqcn, expectedFile] of Object.entries(contract.requiredClassLocations ?? {})) {
const actualClass = classesByName.get(fqcn);
if (!actualClass) violations.push(`required class missing: ${fqcn}`);
@@ -312,12 +327,19 @@ function checkContract(report, contractPath) {
violations.push(`${slice} incoming dependencies changed: ${incoming.join(', ')}`);
}
}
return violations;
}
function checkContract(report, contractPath) {
const contract=JSON.parse(fs.readFileSync(path.resolve(process.cwd(),contractPath),'utf8'));
const violations=contractViolations(report,contract);
if (violations.length > 0) {
process.stderr.write(`Firstleg dependency contract violations in ${contractPath}:\n${violations.map(item => `- ${item}`).join('\n')}\n`);
process.exitCode = 1;
}
}
if (process.argv[1] && import.meta.url === pathToFileURL(path.resolve(process.argv[1])).href) {
const options = parseArgs(process.argv.slice(2));
const report = buildReport(options.sourceSet);
if (options.check) checkContract(report, options.check);
@@ -328,3 +350,5 @@ const rendered = options.format === 'json'
: renderDot(report);
if (options.output) fs.writeFileSync(path.resolve(process.cwd(), options.output), rendered, 'utf8');
else process.stdout.write(rendered);
}
@@ -1,5 +1,7 @@
import assert from 'node:assert/strict';
import { execFileSync } from 'node:child_process';
import { readFileSync } from 'node:fs';
import { contractViolations } from './analyze-firstleg-dependencies.mjs';
import path from 'node:path';
import test from 'node:test';
@@ -7,6 +9,17 @@ const moduleRoot = path.resolve(import.meta.dirname, '..');
const analyzer = path.join(moduleRoot, 'scripts', 'analyze-firstleg-dependencies.mjs');
const contract = path.join(moduleRoot, 'src', 'test', 'resources', 'architecture', 'firstleg-slice-dependencies.json');
test('reviewed original-domain calls do not open an entire slice or allow wildcard grants', () => {
const report=analyze(); const baseline=JSON.parse(readFileSync(contract,'utf8'));
assert.deepEqual(contractViolations(report,baseline),[]);
report.classDependencies.push({source:'com.baiyue.firstleg.service.SmartLoadingService',target:'com.baiyue.firstleg.domain.PriceBookChannelCatalog'});
assert.ok(contractViolations(report,baseline).some(message=>message.includes('SmartLoadingService->com.baiyue.firstleg.domain.PriceBookChannelCatalog')));
baseline.reviewedClassDependencies.push({source:'com.baiyue.firstleg.*',target:'com.baiyue.firstleg.service.FbaPricingService',reason:'invalid wildcard'});
assert.ok(contractViolations(report,baseline).some(message=>message.includes('exact classes')));
report.packageSccs.push(['com.baiyue.firstleg.service','com.baiyue.firstleg.pricebookquery.application']);
assert.ok(contractViolations(report,baseline).some(message=>message.includes('unreviewed package cycle')));
});
function analyze() {
return JSON.parse(execFileSync(process.execPath, [analyzer, '--source-set', 'main', '--format', 'json'], {
cwd: moduleRoot,
@@ -53,7 +66,7 @@ test('customer statistics application layer only depends inward', () => {
assert.deepEqual(outwardDependencies, []);
});
test('price book query is a leaf slice and removes the package cycle', () => {
test('price book query remains a leaf slice outside reviewed pre-existing package cycles', () => {
const report = analyze();
const classes = report.classes.filter(entry => entry.slice === 'pricebook-query');
assert.deepEqual(classes.map(entry => entry.fqcn).sort(), [
@@ -67,7 +80,9 @@ test('price book query is a leaf slice and removes the package cycle', () => {
assert.deepEqual(report.sliceEdges.filter(edge => edge.target === 'pricebook-query')
.map(edge => edge.source).sort(), ['booking-customs-trucking', 'measurement-pricing', 'split-loading']);
assert.equal(report.sliceSccs.some(component => component.includes('pricebook-query')), false);
assert.deepEqual(report.packageSccs, []);
assert.equal(report.packageSccs.some(cycle=>cycle.some(pkg=>pkg.startsWith('com.baiyue.firstleg.pricebookquery'))),false);
const reviewed=JSON.parse(readFileSync(contract,'utf8')).reviewedPackageCycles.map(c=>c.packages);
assert.deepEqual(report.packageSccs,reviewed);
});
test('price book query application and consumers respect ports', () => {
@@ -0,0 +1,12 @@
package com.baiyue.firstleg.client;
import com.baiyue.common.core.api.ApiResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
@FeignClient(name="lastleg-service",contextId="appointmentWorkRouteClient",url="${LASTLEG_SERVICE_URL:${baiyue.clients.lastleg.url:}}")
public interface AppointmentWorkRouteClient {
record Route(String flow) { }
@GetMapping("/internal/lastleg/appointment-work/containers/{id}/route")
ApiResponse<Route> route(@RequestHeader("X-Internal-Service-Token") String token,@PathVariable("id") long id);
}
@@ -12,6 +12,11 @@ import java.util.List;
@FeignClient(name = "warehouse-service", contextId = "firstlegWarehouseMasterDataClient",
url = "${baiyue.clients.warehouse.url:}", path = "/internal/warehouses")
public interface WarehouseMasterDataClient {
@GetMapping("/order-catalog")
ApiResponse<List<CatalogWarehouse>> catalog(@RequestHeader("X-Internal-Service-Token") String token);
record CatalogWarehouse(Long id, String warehouseCode, String warehouseName, String warehouseType, String countryCode) { }
@GetMapping("/{tenantId}/{warehouseId}/active")
ApiResponse<Detail> active(@RequestHeader("X-Internal-Service-Token") String token,
@PathVariable long tenantId,
@@ -26,6 +26,12 @@ import java.util.List;
public class MerchantContainerCustomsController {
@Resource private ContainerCustomsService service;
@GetMapping("/pending-summary")
@PreAuthorize("hasAuthority('merchant:order:view')")
public ApiResponse<PendingSummary> pendingSummary(@AuthenticationPrincipal AuthenticatedUser user) {
return ApiResponse.success(service.merchantPendingSummary(FirstlegScopeGuard.merchant(user)));
}
@GetMapping("/orders/{orderId}")
@PreAuthorize("hasAuthority('merchant:order:view')")
public ApiResponse<ContainerView> order(@AuthenticationPrincipal AuthenticatedUser user,
@@ -74,4 +74,5 @@ public final class ContainerCustomsDtos {
@Size(max = 1000) String resolution) {}
public record Download(String fileName, String contentType, byte[] content) {}
public record PendingSummary(long pendingCount) {}
}
@@ -87,6 +87,42 @@ public interface ContainerCustomsMapper {
""")
Long completedPlanForOrder(@Param("tenantId") long tenantId, @Param("orderId") long orderId);
/** One customer action badge per actual loaded cabinet, including receipt confirmation. */
@Select("""
SELECT COUNT(DISTINCT p.container_booking_id)
FROM fl_loading_plan p
JOIN fl_container_booking b ON b.id=p.container_booking_id AND b.record_status='ACTIVE'
JOIN fl_loading_plan_item item ON item.loading_plan_id=p.id AND item.deleted=0
JOIN fl_inbound_order i ON i.id=item.inbound_id AND i.tenant_id=item.account_id AND i.deleted=0
LEFT JOIN fl_customs_container c ON c.loading_plan_id=p.id
WHERE p.plan_status='COMPLETED' AND i.tenant_id=#{tenantId} AND i.tax_mode='TAX_REFUND'
AND
""" + ACTUAL_ITEM_SCOPE + """
AND p.id=(
SELECT latest.id FROM fl_loading_plan latest
JOIN fl_loading_plan_item item ON item.loading_plan_id=latest.id AND item.deleted=0
JOIN fl_inbound_order own ON own.id=item.inbound_id AND own.tenant_id=item.account_id AND own.deleted=0
WHERE latest.plan_status='COMPLETED' AND own.tenant_id=i.tenant_id AND own.order_id=i.order_id
AND own.tax_mode='TAX_REFUND' AND
""" + ACTUAL_ITEM_SCOPE + """
ORDER BY COALESCE(latest.confirmed_at,latest.updated_at) DESC,latest.id DESC LIMIT 1
)
AND (
((c.id IS NULL OR c.status IN ('WAITING_CUSTOMER_DOCUMENTS','READY_TO_START')) AND NOT EXISTS (
SELECT 1 FROM fl_customs_customer_document_inbound scope
JOIN fl_customs_customer_document d ON d.id=scope.document_id AND d.status='ACTIVE'
WHERE d.customs_container_id=c.id AND d.tenant_id=i.tenant_id
AND scope.tenant_id=i.tenant_id AND scope.inbound_id=i.id))
OR (c.status='DECLARING' AND EXISTS (
SELECT 1 FROM fl_customs_customer_document d
JOIN fl_customs_customer_document_inbound scope ON scope.document_id=d.id AND scope.tenant_id=d.tenant_id
JOIN fl_customs_completion_document receipt ON receipt.source_document_id=d.id
WHERE d.customs_container_id=c.id AND d.tenant_id=i.tenant_id AND d.status='ACTIVE'
AND d.frozen_at IS NOT NULL AND scope.inbound_id=i.id AND receipt.customer_confirm_status='PENDING'))
)
""")
long merchantPendingCount(@Param("tenantId") long tenantId);
@Insert("""
INSERT INTO fl_customs_container
(id,loading_plan_id,container_booking_id,status,created_at,updated_at,version)
@@ -44,6 +44,11 @@ public class ContainerCustomsService {
@Resource private ApplicationEventPublisher events;
@Value("${baiyue.security.internal-service-token}") private String internalToken;
@Transactional(readOnly = true)
public PendingSummary merchantPendingSummary(long tenantId) {
return new PendingSummary(mapper.merchantPendingCount(tenantId));
}
@Transactional
public ContainerView platformView(long planId) {
List<InboundRow> rows = actualPlanRows(planId);
@@ -13,7 +13,7 @@ public final class ContainerOverviewDtos {
public record Overview(ContainerBookingEntityView container, Long loadingPlanId, PdaSummary pda,
List<Document> documents, ExceptionState exception, List<ExceptionHistory> exceptionHistory,
List<TimelineEntry> timeline) {}
public record ContainerBookingEntityView(Long id, String bookingNo, String cabinetNo, String containerNo,
public record ContainerBookingEntityView(Long id, String cabinetNo, String containerNo,
String status, Long warehouseId, String warehouseName, String voyageNo, String vesselName,
String billOfLadingNo, Long shippingCompanyId, String shippingCompanyName,
String departurePortCode, String departurePortName, String destinationPortCode,
@@ -10,8 +10,12 @@ public final class MerchantWorkbenchFilters {
private MerchantWorkbenchFilters() {}
public record Request(@NotNull @Positive Long tenantId,
@Pattern(regexp = "WAIT_MEASURE|WAIT_PALLETIZE|WAIT_SPLIT|LOADING|LOADED|DELIVERED") String mainStatus) {}
@Pattern(regexp = "WAIT_MEASURE|WAIT_PALLETIZE|WAIT_SPLIT|LOADING|LOADED|DELIVERED") String mainStatus,
@jakarta.validation.constraints.Size(min=1,max=200) List<@NotNull @Positive Long> orderIds) {}
public record Response(List<Long> matchingStatusOrderIds, List<Long> feeOrderIds,
List<Long> customsOrderIds) {}
List<Long> customsOrderIds, List<Progress> progress) {}
public record Progress(long orderId, String stage, boolean partial) {}
public record Fragment(long orderId, int stage) {}
}
@@ -48,7 +48,7 @@ public final class SmartLoadingDtos { private SmartLoadingDtos(){}
if (size == 0) size = 20;
}
}
public record WorkbenchContainer(Long bookingId, String bookingNo, String cabinetNo, String containerNo,
public record WorkbenchContainer(Long bookingId, String cabinetNo, String containerNo,
Long warehouseId, String warehouseName, String channelGroupCode, String channelCode, String channelName, String containerType,
BigDecimal capacityCbm, BigDecimal maxWeightKg,
Long planId, String planNo, String planStatus, Integer version) {}
@@ -19,7 +19,6 @@ import java.time.LocalDateTime;
@TableName("fl_container_booking")
public class ContainerBookingEntity {
@TableId(type = IdType.ASSIGN_ID) private Long id;
private String bookingNo;
private String containerNo;
private String cabinetNo;
private String sourceType;
@@ -63,4 +63,39 @@ public interface MerchantWorkbenchFilterMapper {
ORDER BY i.order_id
""")
List<Long> pendingCustoms(@Param("tenantId") long tenantId);
/** Only physically loaded fragments can expose container milestones to the customer. */
@Select("""
<script>
SELECT o.order_id, CASE WHEN owned.container_booking_id IS NULL THEN 0
WHEN EXISTS (SELECT 1 FROM fl_carrier_schedule_node_fact n
WHERE n.container_booking_id=owned.container_booking_id
AND n.standard_node='PICKUP_READY' AND n.actual_at IS NOT NULL) THEN 3
WHEN EXISTS (SELECT 1 FROM fl_customs_container c
WHERE c.loading_plan_id=owned.loading_plan_id AND c.status='COMPLETED') THEN 2
ELSE 1 END AS stage
FROM fl_inbound_order o
LEFT JOIN (
SELECT DISTINCT i.inbound_id, i.account_id, p.id AS loading_plan_id, p.container_booking_id
FROM fl_loading_plan_item i
<if test="orderIds != null">
JOIN fl_inbound_order selected ON selected.id=i.inbound_id AND selected.tenant_id=i.account_id
AND selected.deleted=0 AND selected.order_id IN
<foreach collection="orderIds" item="id" open="(" separator="," close=")">#{id}</foreach>
</if>
JOIN fl_loading_plan p ON p.id=i.loading_plan_id AND p.plan_status='COMPLETED'
JOIN fl_loading_pick_task t ON t.loading_plan_id=p.id AND t.task_status='COMPLETED'
JOIN fl_loading_pick_item picked ON picked.pick_task_id=t.id AND picked.loading_plan_item_id=i.id
JOIN fl_container_booking b ON b.id=p.container_booking_id AND b.record_status='ACTIVE'
WHERE i.account_id=#{tenantId} AND i.deleted=0
AND picked.item_status IN ('PICKED','PARTIAL') AND picked.picked_package_count>0
) owned ON owned.inbound_id=o.id AND owned.account_id=o.tenant_id
WHERE o.tenant_id=#{tenantId} AND o.deleted=0 AND o.order_id IS NOT NULL
AND o.process_status &lt;&gt; 'CANCELLED'
<if test="orderIds != null">
AND o.order_id IN <foreach collection="orderIds" item="id" open="(" separator="," close=")">#{id}</foreach>
</if>
ORDER BY o.order_id
</script>
""")
List<com.baiyue.firstleg.dto.MerchantWorkbenchFilters.Fragment> progressFragments(@Param("tenantId") long tenantId, @Param("orderIds") List<Long> orderIds);
}
@@ -335,7 +335,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ba
@Select("""
<script>
SELECT b.id bookingId,b.booking_no bookingNo,b.cabinet_no cabinetNo,b.container_no containerNo,
SELECT b.id bookingId,b.cabinet_no cabinetNo,b.container_no containerNo,
b.warehouse_id warehouseId,b.warehouse_name warehouseName,b.channel_group_code channelGroupCode,b.channel_code channelCode,
b.channel_name channelName,b.container_type containerType,b.capacity_cbm capacityCbm,
b.max_weight_kg maxWeightKg,p.id planId,p.plan_no planNo,
@@ -0,0 +1,28 @@
package com.baiyue.firstleg.portschedule.controller;
import com.baiyue.common.core.api.ApiResponse;
import com.baiyue.firstleg.portschedule.service.AppointmentForecastService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.server.ResponseStatusException;
import org.springframework.http.HttpStatus;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.util.List;
@RestController
@RequestMapping("/internal/firstleg/appointment-forecasts")
public class InternalAppointmentForecastController {
public record Request(List<Long> containerBookingIds) { }
private final AppointmentForecastService service;
private final String token;
public InternalAppointmentForecastController(AppointmentForecastService service,
@Value("${baiyue.security.internal-service-token:}") String token){this.service=service;this.token=token;}
@PostMapping("/batch")
public ApiResponse<List<AppointmentForecastService.Forecast>> batch(
@RequestHeader(value="X-Internal-Service-Token",required=false) String supplied,@RequestBody Request request) {
if(token==null || token.isBlank() || supplied==null || !MessageDigest.isEqual(token.getBytes(StandardCharsets.UTF_8),supplied.getBytes(StandardCharsets.UTF_8)))
throw new ResponseStatusException(HttpStatus.UNAUTHORIZED,"内部身份无效");
return ApiResponse.success(service.batch(request==null?null:request.containerBookingIds()));
}
}
@@ -0,0 +1,36 @@
package com.baiyue.firstleg.portschedule.controller;
import com.baiyue.common.core.api.ApiResponse;
import com.baiyue.firstleg.portschedule.dto.AppointmentWorkSourceDtos.*;
import com.baiyue.firstleg.portschedule.service.AppointmentWorkSourceService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.web.server.ResponseStatusException;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.util.List;
@RestController
@RequestMapping("/internal/firstleg/appointment-work")
public class InternalAppointmentWorkSourceController {
private final AppointmentWorkSourceService service;
private final String token;
public InternalAppointmentWorkSourceController(AppointmentWorkSourceService service,
@Value("${baiyue.security.internal-service-token:}") String token) { this.service=service; this.token=token; }
@GetMapping("/containers")
public ApiResponse<SourcePage> discover(@RequestHeader(value="X-Internal-Service-Token",required=false) String supplied,
@RequestParam(required=false) String after,@RequestParam(defaultValue="200") int size) {
authorize(supplied); return ApiResponse.success(service.discover(after,size));
}
@GetMapping("/containers/{id}")
public ApiResponse<ContainerSource> container(@RequestHeader(value="X-Internal-Service-Token",required=false) String supplied,
@PathVariable long id) { authorize(supplied); return ApiResponse.success(service.container(id)); }
@PostMapping("/facts")
public ApiResponse<List<Fact>> facts(@RequestHeader(value="X-Internal-Service-Token",required=false) String supplied,
@RequestBody List<FactRequest> requests) { authorize(supplied); return ApiResponse.success(service.facts(requests)); }
private void authorize(String supplied) {
if(token==null || token.isBlank() || supplied==null || !MessageDigest.isEqual(token.getBytes(StandardCharsets.UTF_8),supplied.getBytes(StandardCharsets.UTF_8)))
throw new ResponseStatusException(HttpStatus.UNAUTHORIZED,"内部身份无效");
}
}
@@ -37,6 +37,18 @@ import java.util.List;
public class PlatformPortScheduleController {
@Resource private PortScheduleService service;
@GetMapping("/arrival-calendar")
@PreAuthorize("hasAuthority('platform:appointment:list')")
public ApiResponse<List<com.baiyue.firstleg.portschedule.dto.ArrivalCalendarEntry>> arrivalCalendar(
@AuthenticationPrincipal AuthenticatedUser user,
@org.springframework.web.bind.annotation.RequestParam
@org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) java.time.LocalDate from,
@org.springframework.web.bind.annotation.RequestParam
@org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) java.time.LocalDate to) {
FirstlegScopeGuard.platform(user);
return ApiResponse.success(service.arrivalCalendar(from, to));
}
@GetMapping
@PreAuthorize("hasAuthority('platform:firstleg:port-schedule:list')")
public ApiResponse<PageResult<ScheduleView>> page(@AuthenticationPrincipal AuthenticatedUser user,
@@ -0,0 +1,29 @@
package com.baiyue.firstleg.portschedule.dto;
import java.time.*;
import java.util.List;
/** Internal wire values. Unzoned source timestamps are never converted using the server zone. */
public final class AppointmentWorkSourceDtos {
private AppointmentWorkSourceDtos() { }
public record Reference(String kind, String key, String businessNo, String label) { }
public record SourceReference(String customerId,String sourceKey,String destinationKey) { }
public record Requirement(String requirementKey, String batchKey, String batchNo, String destinationKind,
String originName, String destinationName, String timezone, List<Reference> references, List<String> replacesRequirementKeys,
List<SourceReference> sources) { }
public record ContainerSource(String containerBookingId, String containerNo, Instant departedAt,
LocalDateTime departedLocalAt, LocalDateTime sailedEvidenceLocalAt, String sourceVersion, String establishedFlow, String timezone, List<Requirement> requirements) { }
public record SourcePage(List<ContainerSource> containers, String nextCursor, boolean complete, String scopeVersion) { }
public record ContainerReference(String containerBookingId, String bookingNo, String containerNo) { }
public record FactRequest(String workItemKey, String type, String flow, String containerBookingId,
String requirementKey, String batchKey, String tripKey, List<String> batchKeys, List<ContainerReference> containers,List<SourceReference> sources) { }
public record Slot(LocalDate date, LocalTime startTime, LocalDate endDate, LocalTime endTime, String timezone) { }
public record Actual(Instant occurredAt, LocalDateTime localOccurredAt, String timezone) { }
public record Target(String kind, String containerBookingId) { }
public record Action(String code, String label, String targetWorkItemKey, Target target) { }
public record Responsibility(String kind, String id, String name) { }
public record Fact(String workItemKey, String fingerprint, String impactToken, boolean planExists, String planStatus,
String executionStatus, Slot target, Slot confirmed, Actual actual, String timezone, String businessNo, String tripKey,
List<String> readPermissions, List<String> actionPermissions, Action action, List<String> blockReasons,
List<String> missingFields, List<Reference> references, Responsibility responsibility) { }
}
@@ -0,0 +1,7 @@
package com.baiyue.firstleg.portschedule.dto;
import java.time.LocalDateTime;
public record ArrivalCalendarEntry(Long containerBookingId, String cabinetNo, String containerNo,
String vesselName, String voyageNo, String destinationPortName, String destinationWarehouseCode,
LocalDateTime arrivalAt, String arrivalType) {}
@@ -0,0 +1,26 @@
package com.baiyue.firstleg.portschedule.mapper;
import org.apache.ibatis.annotations.*;
import java.time.LocalDateTime;
import java.util.List;
@Mapper
public interface AppointmentForecastMapper {
record Fact(Long containerBookingId,Long factId,String providerCode,String sourceReference,
LocalDateTime observedAt,LocalDateTime estimatedAt,LocalDateTime actualAt) { }
@Select("""
<script>
SELECT container_booking_id,fact_id,provider_code,source_reference,observed_at,estimated_at,actual_at
FROM (
SELECT f.container_booking_id,f.id AS fact_id,f.provider_code,f.source_reference,
f.observed_at,f.estimated_at,f.actual_at,
ROW_NUMBER() OVER (PARTITION BY f.container_booking_id ORDER BY f.observed_at DESC,f.id DESC) AS position
FROM fl_carrier_schedule_node_fact f JOIN fl_container_booking c ON c.id=f.container_booking_id
WHERE c.record_status='ACTIVE' AND f.standard_node='ARRIVED_DESTINATION_PORT'
AND f.container_booking_id IN
<foreach collection='ids' item='id' open='(' separator=',' close=')'>#{id}</foreach>
) ranked WHERE position&lt;=2 ORDER BY container_booking_id,position
</script>
""")
List<Fact> latest(@Param("ids") List<Long> containerIds);
}
@@ -0,0 +1,64 @@
package com.baiyue.firstleg.portschedule.mapper;
import org.apache.ibatis.annotations.*;
import java.time.LocalDateTime;
import java.util.List;
@Mapper
public interface AppointmentWorkSourceMapper {
record Source(long id, String cabinetNo, String containerNo, String departurePortName,
String destinationWarehouseName, LocalDateTime departedLocalAt, LocalDateTime sailedEvidenceLocalAt, int version, long factVersion, long deliveryVersion) { }
record Cargo(long inboundId, long customerId, long orderId, String orderNo, String inboundCode,
String destinationKind, String destinationCode, String destinationName, int packageCount) { }
record ContainerCargo(long containerBookingId,long inboundId,long customerId,long orderId,String orderNo,String inboundCode,
String destinationKind,String destinationCode,String destinationName,int packageCount) {
public Cargo cargo() { return new Cargo(inboundId,customerId,orderId,orderNo,inboundCode,destinationKind,destinationCode,destinationName,packageCount); }
}
String SOURCE_ROWS = """
SELECT b.id,b.cabinet_no,b.container_no,b.departure_port_name,b.destination_warehouse_name,
MIN(CASE WHEN f.standard_node='DEPARTED_ORIGIN_PORT' THEN f.actual_at END) departed_local_at,
MIN(f.actual_at) sailed_evidence_local_at,
b.version,MAX(f.id) fact_version,
(SELECT COUNT(*) FROM fl_direct_delivery_unloading d WHERE d.container_booking_id=b.id) delivery_version
FROM fl_container_booking b JOIN fl_carrier_schedule_node_fact f ON f.container_booking_id=b.id
WHERE b.record_status='ACTIVE' AND f.actual_at IS NOT NULL
AND f.standard_node IN ('DEPARTED_ORIGIN_PORT','IN_TRANSIT','ARRIVED_DESTINATION_PORT',
'DISCHARGED_FROM_VESSEL','PICKUP_READY','PICKED_UP','EMPTY_RETURNED')
""";
String SOURCE_ORDER = """
GROUP BY b.id,b.cabinet_no,b.container_no,b.departure_port_name,b.destination_warehouse_name,b.version
ORDER BY b.id
""";
// A complete identity/version manifest also detects deletions or edits between cursor pages.
@Select(SOURCE_ROWS + SOURCE_ORDER)
List<Source> sources();
/** Same live eligibility and aggregate facts as the manifest, restricted before aggregation. */
@Select("<script>" + SOURCE_ROWS + """
<choose>
<when test="ids != null and !ids.isEmpty()">
AND b.id IN <foreach collection='ids' item='id' open='(' separator=',' close=')'>#{id}</foreach>
</when>
<otherwise>AND 1=0</otherwise>
</choose>
""" + SOURCE_ORDER + "</script>")
List<Source> sourcesByIds(@Param("ids") List<Long> ids);
@Select("""
<script>
SELECT p.container_booking_id,i.inbound_id, i.account_id customer_id, i.order_id, i.order_no,i.inbound_code,
o.destination_type destination_kind,i.destination_warehouse_code destination_code,
i.destination_warehouse_name destination_name,SUM(i.package_count) package_count
FROM fl_loading_plan p JOIN fl_loading_plan_item i ON i.loading_plan_id=p.id AND i.deleted=0
JOIN fl_inbound_order o ON o.id=i.inbound_id
WHERE p.container_booking_id IN
<foreach collection='ids' item='id' open='(' separator=',' close=')'>#{id}</foreach>
AND p.plan_status='COMPLETED'
GROUP BY p.container_booking_id,i.inbound_id,i.account_id,i.order_id,i.order_no,i.inbound_code,o.destination_type,
i.destination_warehouse_code,i.destination_warehouse_name
ORDER BY p.container_booking_id,i.inbound_id
</script>
""")
List<ContainerCargo> cargo(@Param("ids") List<Long> ids);
}
@@ -15,6 +15,15 @@ import java.util.List;
@Mapper
public interface CarrierScheduleQueryMapper extends BaseMapper<CarrierScheduleQueryEntity> {
@Select("""
SELECT container_booking_id FROM fl_carrier_schedule_node_fact
WHERE standard_node='PICKED_UP' AND actual_at IS NOT NULL
GROUP BY container_booking_id
HAVING MAX(actual_at)>=#{from} AND MAX(actual_at)<#{to}
ORDER BY MAX(actual_at),container_booking_id LIMIT 1001
""")
List<Long> selectPickupCalendarContainers(@Param("from") LocalDateTime from,@Param("to") LocalDateTime to);
@Select("""
<script>
SELECT * FROM fl_carrier_schedule_query
@@ -11,6 +11,26 @@ import org.apache.ibatis.annotations.Update;
@Mapper
public interface PortScheduleMapper extends BaseMapper<PortScheduleEntity> {
@Select("""
SELECT c.id containerBookingId,c.cabinet_no cabinetNo,c.container_no containerNo,
c.vessel_name vesselName,c.voyage_no voyageNo,c.destination_port_name destinationPortName,
c.destination_warehouse_code destinationWarehouseCode,
COALESCE(n.actual_at,c.actual_port_arrival_at,c.estimated_port_arrival_at) arrivalAt,
CASE WHEN COALESCE(n.actual_at,c.actual_port_arrival_at) IS NOT NULL THEN 'ACTUAL' ELSE 'ESTIMATED' END arrivalType
FROM fl_container_booking c
LEFT JOIN fl_carrier_schedule_node_fact n ON n.container_booking_id=c.id
AND n.standard_node='ARRIVED_DESTINATION_PORT' AND n.actual_at IS NOT NULL
AND n.id=(SELECT n2.id FROM fl_carrier_schedule_node_fact n2
WHERE n2.container_booking_id=c.id AND n2.standard_node='ARRIVED_DESTINATION_PORT'
AND n2.actual_at IS NOT NULL ORDER BY n2.observed_at DESC,n2.id DESC LIMIT 1)
WHERE c.record_status='ACTIVE'
AND COALESCE(n.actual_at,c.actual_port_arrival_at,c.estimated_port_arrival_at)>=#{from}
AND COALESCE(n.actual_at,c.actual_port_arrival_at,c.estimated_port_arrival_at)<#{to}
ORDER BY arrivalAt,c.id
""")
java.util.List<com.baiyue.firstleg.portschedule.dto.ArrivalCalendarEntry> arrivalCalendar(
@Param("from") java.time.LocalDateTime from, @Param("to") java.time.LocalDateTime to);
@Select("""
<script>
SELECT * FROM fl_port_schedule
@@ -49,6 +49,9 @@ public class CarrierScheduleQueryRepository {
public List<ContainerActualFacts> containerActualFacts(List<Long> containerBookingIds) {
return queries.selectContainerActualFacts(containerBookingIds);
}
public List<Long> pickupCalendarContainers(LocalDateTime from, LocalDateTime to) {
return queries.selectPickupCalendarContainers(from, to);
}
public List<CarrierScheduleQueryEntity> due(LocalDateTime now, int limit) { return queries.selectDue(now, limit); }
public boolean claimLease(long id, String owner, LocalDateTime now, LocalDateTime leaseUntil) {
return queries.claimLease(id, owner, now, leaseUntil) == 1;
@@ -35,6 +35,10 @@ public class PortScheduleRepository {
return PageResult.from(schedules.selectPage(new Page<>(query.page(), query.size()), query));
}
public PortScheduleEntity find(long id) { return schedules.selectById(id); }
public List<com.baiyue.firstleg.portschedule.dto.ArrivalCalendarEntry> arrivalCalendar(
java.time.LocalDateTime from, java.time.LocalDateTime to) {
return schedules.arrivalCalendar(from, to);
}
public PortScheduleEntity latestForDispatch(long customerId, long oceanBookingId, long containerBookingId) {
return schedules.latestForDispatch(customerId, oceanBookingId, containerBookingId);
}
@@ -0,0 +1,26 @@
package com.baiyue.firstleg.portschedule.service;
import com.baiyue.firstleg.portschedule.mapper.AppointmentForecastMapper;
import org.springframework.stereotype.Service;
import org.springframework.http.HttpStatus;
import org.springframework.web.server.ResponseStatusException;
import java.util.*;
import java.util.stream.Collectors;
/** Forecast facts are read from their owning service, never inferred from an order snapshot. */
@Service
public class AppointmentForecastService {
public record Forecast(Long containerBookingId,AppointmentForecastMapper.Fact latest,
AppointmentForecastMapper.Fact previous,String timeBasis) { }
private final AppointmentForecastMapper mapper;
public AppointmentForecastService(AppointmentForecastMapper mapper){this.mapper=mapper;}
public List<Forecast> batch(List<Long> ids) {
if(ids==null || ids.isEmpty() || ids.size()>200 || ids.stream().anyMatch(id->id==null || id<=0)
|| new HashSet<>(ids).size()!=ids.size()) throw new ResponseStatusException(HttpStatus.BAD_REQUEST,"每批须提供1至200个不重复的柜次");
var facts=mapper.latest(ids).stream().collect(Collectors.groupingBy(AppointmentForecastMapper.Fact::containerBookingId));
return ids.stream().map(id->{
var rows=facts.getOrDefault(id,List.of());
return new Forecast(id,rows.isEmpty()?null:rows.get(0),rows.size()<2?null:rows.get(1),"SOURCE_LOCAL_UNSPECIFIED");
}).toList();
}
}

Some files were not shown because too many files have changed in this diff Show More