|
@@ -1142,7 +1142,7 @@ where a.OrderStatus<3 and a.SystemNo in @SystemNo";//小于三属于未装箱数
|
|
|
DateTime updateLast = DateTime.Now.AddHours(-2);
|
|
|
DateTime receiveLast = DateTime.Now.AddHours(-4);
|
|
|
DateTime receiveFirst = DateTime.Now.AddDays(-24);
|
|
|
- string sql = @$"select top 100 IsOnline,CustomerId,SourceType,CustomerOrderNo,ERPApiId,Id,ServicesOrderNo,SystemNo,case when ChannelId in (702,703) then ServiceOrderNumber3 else TrackingNumber end TrackingNumber,ChannelId,datediff(HOUR,ReceiveTime,getdate()) from Order_Order(nolock)
|
|
|
+ string sql = @$"select top 100 IsOnline,CustomerId,SourceType,CustomerOrderNo,ERPApiId,Id,ServicesOrderNo,SystemNo,case when ChannelId in (702,703) then ServiceOrderNumber3 when channelId in (977) then ServiceOrderNumber2 else TrackingNumber end TrackingNumber,ChannelId,datediff(HOUR,ReceiveTime,getdate()) from Order_Order(nolock)
|
|
|
where orderStatus<4 and OrderStatus>=2
|
|
|
and ReceiveTime>'{receiveFirst.ToString_yyyyMMddHHmmss()}'
|
|
|
and ReceiveTime<'{receiveLast.ToString_yyyyMMddHHmmss()}'
|
|
@@ -1152,11 +1152,11 @@ where a.OrderStatus<3 and a.SystemNo in @SystemNo";//小于三属于未装箱数
|
|
|
//string sql = @$"select top {qty} SourceType,CustomerOrderNo,ERPApiId,Id,ServicesOrderNo,SystemNo,TrackingNumber,ChannelId,datediff(HOUR,ReceiveTime,getdate()) from Order_Order(nolock)
|
|
|
// where WaitSysncServiceTrackingNumber=1 and orderStatus<>4 and OrderStatus>=2 and datediff(HOUR,UpdateTime,getdate())>2 and ReceiveTime>'2022-05-05' and datediff(HOUR,ReceiveTime,getdate())>4 and datediff(day,ReceiveTime,getdate())<24";
|
|
|
//sql = @"select SourceType,CustomerOrderNo,ERPApiId,Id,ServicesOrderNo,SystemNo,case when ChannelId in (702,703) then ServiceOrderNumber3 else TrackingNumber end TrackingNumber,ChannelId,datediff(HOUR,ReceiveTime,getdate()) from order_order where SystemNo = 'XYYEX0032515406YQ'";
|
|
|
- string testSql = @$"select top 100 IsOnline,CustomerId,SourceType,CustomerOrderNo,ERPApiId,Id,ServicesOrderNo,SystemNo,case when ChannelId in (702,703) then ServiceOrderNumber3 else TrackingNumber end TrackingNumber,ChannelId,datediff(HOUR,ReceiveTime,getdate()) from Order_Order(nolock)
|
|
|
- where SystemNo='XYYEX0033401618YQ'
|
|
|
+ string testSql = @$"select top 100 IsOnline,CustomerId,SourceType,CustomerOrderNo,ERPApiId,Id,ServicesOrderNo,SystemNo,case when ChannelId in (702,703) then ServiceOrderNumber3 when channelId in (977) then ServiceOrderNumber2 else TrackingNumber end TrackingNumber,ChannelId,datediff(HOUR,ReceiveTime,getdate()) from Order_Order(nolock)
|
|
|
+ where SystemNo='XYYEX0034582669YQ'
|
|
|
";
|
|
|
|
|
|
- var data = await _orderRepository.QueryBySqlAsync(sql);
|
|
|
+ var data = await _orderRepository.QueryBySqlAsync(testSql);
|
|
|
List<Task> tasks = new List<Task>();
|
|
|
foreach (var item in data.GroupBy(x => x.ChannelId))
|
|
|
{
|