varlast_task_synchro_log=conn.QuerySingleOrDefault<task_synchro_log>(" select * from task_synchro_log where task_name=@task_name and status=1 order by end_time desc limit 1 ",new{task_name=task_name});
db_data.id=conn.QueryFirstOrDefault<int?>(" select id from dc_base_trans_temp_schedule where `purchase_code`=@purchase_code and `sku`=@sku ",new{sku=db_data.sku,purchase_code=db_data.purchase_code})??0;
if(db_data.id>0)
{
conn.Update(db_data);
}
else
{
conn.Insert(db_data);
}
count++;
}
}
}
if(data_skus!=null&&data_skus.Count>=1)
{
// 计算相关sku的总在途
vartemp_datas=_connection.Query<temp_sum_dto>(@"select sku_ware_no,sku as 'bailun_sku',target_ware_no as 'warehouse_code',sum(product_num) as 'count' from dc_base_trans_temp_schedule
where is_delete=0 and is_temp_data=1 and is_exception=0
and sku_ware_no in @sku_ware_nos
GROUP BY sku_ware_no",new{sku_ware_nos=data_skus.Select(s=>s.sku_ware_no).Distinct().ToList()});
foreach(varitemintemp_datas)
{
_connection.Execute("update dc_mid_transit set quantity_transfer_temp_schedule=@quantity_transfer_temp_schedule where bailun_sku=@bailun_sku and warehouse_code=@warehouse_code ",new