varbailun_skus=_connection.Query<dc_base_oms_sku>(" select * from dc_base_oms_sku_30 where warehouse_code='GZBLLM' and paid_time>=@btime ",new
{
btime=DateTime.Now.AddDays(-30)
},commandTimeout:0).ToList();
if(bailun_skus!=null&&bailun_skus.Count>=1)
{
// 找出这些sku是否有在海外仓有库存或者发货过
varstockDatas=_connection.Query<dc_base_stock_warehouse_dto>($@" select t1.*,t2.area_name from dc_base_stock as t1
left join dc_base_warehouse as t2 on t1.warehouse_code = t2.warehouse_code
where t2.hq_type in ('海外仓','第三方仓') and t1.warehouse_code in @warehouse_codes and t1.bailun_sku in @bailun_skus and (t1.usable_stock>0 || t1.shipped_stock>0) ",new{
varcountry_code=_connection.QueryFirstOrDefault<string>(" select `code` from dc_base_country where `name`=@name ",new{
name=item.FirstOrDefault().area_name
});
// 把这个国家的单,都转到海外仓
_connection.Execute(" update dc_base_oms_sku_30 set warehouse_code=@warehouse_code where bailun_order_id in @bailun_order_ids and bailun_sku in @bailun_skus and receipt_country=@receipt_country ",new{
_connection.Execute(" update dc_base_oms_sku set warehouse_code=@warehouse_code where bailun_order_id in @bailun_order_ids and bailun_sku in @bailun_skus and receipt_country=@receipt_country ",new{