Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

当站点被设置为分站点时,需要做的迁移动作

数量和sql,只写觉的重要的数据,以下数据为,假如19站点改为分站点后,要进行的操作

迁移项

备注

数量(19站点)

SQL

客户站点开通

开通主站点, 设置分站点webhook

 

 

库存

通过设置主站点容器,自动同步

 

库位

N

过道

N

 

 

库区

N

 

 

仓库

N

 

 

产品

sql迁移到主站点
company_product
product_stock_level
product_stock_volume_level

产品入库周期

sql迁移到主站点 company_product_date_stock
company_product_stock_to_use
product_stock_daily_data
product_stock_daily_data_by_quantity

client_temp_storage_volume_transaction

client_company_date_temp_storage_volume

client_company_temp_storage_volume_daily_data

company_product_date_stock 参考 主站点数据,分站点的用SQL group by 到主站点。

迁移SQL:

//参考合并库存SQL

delete from company_product_date_stock where company_id=1;

insert into company_product_date_stock select 1 as company_id,product_id,date,sum(stock),now() as update_time,type from company_product_date_stock where company_id in (1,19,20) group by product_id,date,type;

订单

sql迁移到主站点
consignment,
未处理完的订单走【主站点迁移到分站点的流程】

19: 15070689

Code Block
select count(id) from consignment where company_id in (19);

 本地订单中已完成的订单,直接update consignment set company_id=xxx where company_id=19 and type='LOCAL' and status in ('FINISHED','DELETED');

本地订单中未完成的订单, 分已扣库存(待拣货,拣货中,处理中)的和没扣库存(准备中,待处理)的。

准备中待处理的移到主站点,但要通过界面按钮手动同步副本到分站点。
待拣货拣货中,处理中的留在分站点 (因为得跟着库存记录走),但要考虑在主站点扣费的问题 和 换成分站点邮递服务的问题

专线,代理专线这些,已完成的直接去主站点,未完成的去主站点,且要通过按钮手动同步到分站点

订单产品

跟随订单

19: 5376313

Code Block
select count(consignment_product.id) from consignment_product
inner join consignment on consignment.id = consignment_product.consignment_id
where company_id in (19);

代理专线订单产品

跟随订单

19: 11271884

Code Block
select count(agent_direct_consignment_product.id) from agent_direct_consignment_product
inner join consignment on consignment.id = agent_direct_consignment_product.consignment_id
where consignment.company_id in (19);

邮递服务

sql迁移到主站点,需改名字
delivery_service,

迁移后,需要产品梳理,告知要改为主站的哪个服务,再做统一修改。

19: 639

Code Block
select * from delivery_service where company_id in (19);

(1)迁移SQL: update delivery_service set company_id=1,name=concat('19-',name) where company_id=19;

(2)在分站点创建对应的服务,在主站点中设置好邮递服务关联

(3) 通过界面按钮同步邮递服务下未完成的订单

服务商

sql迁移到主站点,需改名字
consignment_delivery_agent
迁移后,需要产品梳理,告知要改为主站的哪个服务,再做统一修改。

19: 23

Code Block
select * from consignment_delivery_agent where company_id = 19; 

(1) 迁移SQL: update consignment_delivery_agent set company_id=1,name=concat('19-',name) where company_id=19;

(2)  清除redis缓存

服务商账号

sql迁移到主站点,需改名字
consignment_delivery_agent_account
consignment_delivery_agent_account_config
迁移后,需要产品梳理,告知要改为主站的哪个服务,再做统一修改。

19: 46个account , 634个config

(1) select count(*) from consignment_delivery_agent_account
join consignment_delivery_agent on consignment_delivery_agent.id = consignment_delivery_agent_id
where company_id=19;

(2) select count(*) from consignment_delivery_agent_account_config
join consignment_delivery_agent_account on consignment_delivery_agent_account.id = consignment_delivery_agent_account_id
join consignment_delivery_agent on consignment_delivery_agent.id = consignment_delivery_agent_id
where company_id=19;

不处理, 与consignment_delivery_agent绑定的。移了consignment_delivery_agent 即可

为了稳定起见,要清除redis缓存

包裹尺寸

sql迁移到主站点,需改名字
delivery_package_size
迁移后,需要产品梳理,告知要改为主站的哪个服务,再做统一修改。

19:94

Code Block
select * from delivery_package_size where company_id in (19);

update delivery_package_size set company_id=1,name=concat('19-',name) where company_id=19;

清除redis缓存

邮递服务服务类型

sql迁移到主站点
delivery_service_service_type

update delivery_service_service_type set company_id=1,name=concat('19-',name) where company_id=19;

清除redis缓存

客户组

sql迁移到主站点
client_group

update client_group set company_id=1 where company_id=19;

暂不移? 例如1,19合并成一个主站点,不确定用哪边的客户组吧?

邮费,手续费,仓储费,邮票

跟随客户组,邮递服务,包裹尺寸

 不处理

客户发货单

N

提单

N

物流计划

N

批次&箱&包裹

N

仓库调拨单&仓库调拨箱

N