varoldId=_connection.QuerySingleOrDefault<int>(" select id from dc_base_transfer_freight_log where action_log_id=@action_log_id limit 1 ",new{action_log_id=data_log.action_log_id});
select t2.sku ,t1.targetwareno,t2.deliverycount,t1.estimatedcost,t3.deliverycount as 'order_deliverycount' from dc_base_transfer_info as t1
left join dc_base_transfer_info_skus as t2 on t1.dataid = t2.dataid
left join ( select dataid,sum(deliverycount) as 'deliverycount' from dc_base_transfer_info_skus GROUP BY dataid ) as t3 on t1.dataid = t3.dataid
where t2.sku=@sku and t1.targetwareno=@targetwareno and t1.estimatedcost>0 and t1.creationtime<=@date and t1.stateid=5 and t1.isdeleted=0 order by t1.creationtime DESC
id=(_connection.QueryFirstOrDefault<int?>(" select id from dc_base_transfer_freight where bailun_sku=@bailun_sku and warehouse_code=@warehouse_code ",new
select t2.sku ,t1.targetwareno,t2.deliverycount,t1.estimatedcost,t3.deliverycount as 'order_deliverycount' from dc_base_transfer_info as t1
select t2.sku ,t1.targetwareno,t2.deliverycount,t2.storagecount,t1.estimatedcost,t3.deliverycount as 'order_deliverycount' from dc_base_transfer_info as t1
left join dc_base_transfer_info_skus as t2 on t1.dataid = t2.dataid
left join dc_base_transfer_info_skus as t2 on t1.dataid = t2.dataid
left join ( select dataid,sum(deliverycount) as 'deliverycount' from dc_base_transfer_info_skus GROUP BY dataid ) as t3 on t1.dataid = t3.dataid
left join ( select dataid,sum(deliverycount) as 'deliverycount' from dc_base_transfer_info_skus GROUP BY dataid ) as t3 on t1.dataid = t3.dataid
where t2.sku=@sku and t1.targetwareno=@targetwareno and t1.estimatedcost>0 and t1.stateid=5 and t1.isdeleted=0 order by t1.creationtime DESC
where t1.isdeleted=0 and t1.stateid not in (5,11,12)
and t2.deliverycount > t2.storagecount
and t1.isexception = 0
and t1.expectarrivaltime >='1991-01-01' and t2.sku=@sku and t1.targetwareno=@targetwareno and t1.estimatedcost>0 order by t1.creationtime DESC
data_log.id=_connection.QuerySingleOrDefault<int?>(" select * from dc_base_transfer_freight_log where bailun_sku=@bailun_sku and warehouse_code=@warehouse_code ",new{
varstock=_connection.QueryFirstOrDefault<int?>(" select usable_stock from dc_base_stock as t1 where t1.bailun_sku=@bailun_sku and t1.warehouse_code=@warehouse_code ",parameters)??0;
if(stock>0)
{
varlogs=_connection.Query<order_transfer_status_log>(" select * from order_transfer_status_log as t1 where t1.bailun_sku=@bailun_sku and t1.warehouse_code=@warehouse_code and is_delete=0 ",parameters).ToList();
mainData.id=_connection.QuerySingleOrDefault<int?>(" select id from dc_base_transfer_freight where bailun_sku=@bailun_sku and warehouse_code=@warehouse_code ",new
{
bailun_sku=mainData.bailun_sku,
warehouse_code=mainData.warehouse_code,
})??0;
if(mainData.id<=0)
{
_connection.Insert(mainData);
}
else
{
_connection.Update(mainData);
}
}
}
}
...
@@ -235,8 +249,6 @@ where t2.sku=@sku and t1.targetwareno=@targetwareno and t1.estimatedcost>0 and t
...
@@ -235,8 +249,6 @@ where t2.sku=@sku and t1.targetwareno=@targetwareno and t1.estimatedcost>0 and t
{
{
Console.WriteLine(ex.Message);
Console.WriteLine(ex.Message);
}
}
}
}
}
publicclassstock_dto
publicclassstock_dto
...
@@ -251,6 +263,7 @@ where t2.sku=@sku and t1.targetwareno=@targetwareno and t1.estimatedcost>0 and t
...
@@ -251,6 +263,7 @@ where t2.sku=@sku and t1.targetwareno=@targetwareno and t1.estimatedcost>0 and t