Commit 0ccc9f5f by 岳巧源

guide

parent 39be1b02
Showing with 69 additions and 0 deletions
```sql
CREATE TABLE `lie_shipping_intermediate_data` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`source_type` tinyint(4) unsigned NOT NULL DEFAULT '1' COMMENT '来源类型 1-入库明细 2-委托单',
`source_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '来源id',
`kingdee_sales_order_no` varchar(64) NOT NULL DEFAULT '' COMMENT '金蝶销售单号',
`purchase_sn` varchar(32) NOT NULL DEFAULT '' COMMENT '采购单号',
`kingdee_purchase_order_no` varchar(64) NOT NULL DEFAULT '' COMMENT '金蝶采购单号',
`goods_id` mediumint(8) unsigned NOT NULL COMMENT '商品ID',
`goods_sn` varchar(32) NOT NULL DEFAULT '' COMMENT '商品编码',
`goods_name` varchar(128) NOT NULL DEFAULT '' COMMENT '商品型号',
`brand_id` mediumint(6) unsigned NOT NULL DEFAULT '0' COMMENT '品牌ID',
`brand_name` varchar(128) NOT NULL DEFAULT '' COMMENT '品牌',
`company_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '采购组织ID 采购组织ID 1猎芯-含税 2深茂电子-不含税',
`company_name` varchar(128) NOT NULL DEFAULT '' COMMENT '采购组织名称',
`supplier_id` mediumint(6) unsigned NOT NULL DEFAULT '0' COMMENT '供应商ID',
`supplier_name` varchar(128) NOT NULL DEFAULT '' COMMENT '供应商名称',
`warehouse_receipt_sn` varchar(32) NOT NULL DEFAULT '' COMMENT '入仓单号',
`in_qty` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '入库数量',
`out_qty` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '发货数量',
`stock_in_status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '0-待入库 1-部分入库 2-全部入库',
`create_name` varchar(32) NOT NULL DEFAULT '' COMMENT '创建人',
`shipping_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '物流id',
`create_uid` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '创建人UID',
`shipment_number` varchar(512) NOT NULL DEFAULT '' COMMENT '物流单号',
`shipping_name` varchar(64) NOT NULL DEFAULT '' COMMENT '物流公司',
`create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
`update_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
`purchase_uid` mediumint(5) unsigned NOT NULL DEFAULT '0' COMMENT '采购员UID',
`purchase_name` varchar(32) NOT NULL DEFAULT '' COMMENT '采购员名字',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='物流中间表数据';
```
## 数据来源
- lie_stock_in和lie_stock_in_items //入库
- 根据`stock_in_id`关联
- 只取 `stock_in_type` in (1,2) 的数据
- lie_scm_order //委托单
## 监听表新增/初始化
- lie_stock_in和lie_stock_in_items
- lie_scm_order
## 监听表变动
- lie_stock_in
- status
- shipping_name
- shipment_number
- shipping_id
- lie_stock_in_items
- out_qty
- in_qty
## 其他字段来源
- kingdee_sales_order_no->`lie_frq`表的`erp_sn`
- 关联frq的逻辑
- lie_scm_order需要先根据`purchase_item_id`关联`lie_purchase_items`表的`purchase_item_id`,获得表`lie_purchase_items`里面的`frq_id`,再根据`frq_id`关联 `lie_frq`表
- lie_stock_in_items 直接根据frq_id 关联`lie_frq`表
- purchase_sn->`lie_purchase_order`表的`purchase_sn`
- 2者都根据`purchase_id`关联`lie_purchase_order`表的`purchase_id`
- kingdee_purchase_order_no->`lie_purchase_order`表的`erp_purchase_sn`
- 2者都根据`purchase_id`关联`lie_purchase_order`表的`purchase_id`
- company_id->`lie_purchase_order`表的`company_id`
- 2者都根据`purchase_id`关联`lie_purchase_order`表的`purchase_id`
- company_name->`lie_purchase_order`表的`company_name`
- 2者都根据`purchase_id`关联`lie_purchase_order`表的`purchase_id`
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment