conn.Execute(" update dc_auto_purchase_advise_detailed set quantity_actual=quantity_init_advise where quantity_actual<=0 and main_id=@mainID ",new{mainID=lastPurchaseAdvise.id},transaction);
varresult=ApiServices.PushBuyPlan(datas);
conn.Execute(" update dc_auto_purchase_advise set buy_sys_plan_no=@buy_sys_plan_no,push_time=@push_time ",new{buy_sys_plan_no=result.planNo,push_time=now},transaction);
varresult=ApiServices.PushBuyPlan(data);
if(result.IsSuccessed)
{
// 把相关的采购明细都标记成已推送
conn.Execute(" update dc_auto_purchase_advise_detailed set ispush=1 where id in @ids ",new{ids=item.Select(s=>s.id).ToArray()});
}
planNos.Add(result.planNo);
}
conn.Execute(" update dc_auto_purchase_advise set buy_sys_plan_no=@buy_sys_plan_no,push_time=@push_time ",new{buy_sys_plan_no=string.Join(",",planNos),push_time=now},transaction);