Explorar el Código

修改按日输入提货费筛选时间为发货时间

hu hao hace 4 años
padre
commit
47bbdc9775

+ 1 - 0
app/Services/StationRuleBatchService.php

@@ -74,6 +74,7 @@ class StationRuleBatchService
             Cache::tags([ '波次防重叠'.$batch['id']])->put($batch['id'],true,config('haiRou.波次防重叠时间_秒'));
         }
         LogService::log(__METHOD__,'shouldProcess','波次任务分配1.3:'.json_encode($batches_toProcess));
+        dump($batches_toProcess);
         return $batches_toProcess;
     }
 }

+ 1 - 1
app/Services/WaybillService.php

@@ -168,7 +168,7 @@ class WaybillService
         if ($waybills->isEmpty()) return false;
         foreach ($waybills as $waybill){
             if (!$waybill['carrier_weight_other'] && !$waybill['carrier_weight']) return null;
-            if (!$waybill['carrier_weight_other']) $waybill['carrier_weight_other']=($waybill['carrier_weight']/0.4);
+            if (!$waybill['carrier_weight_other']) $waybill['carrier_weight_other']=($waybill['carrier_weight']/0.004);
         }
         $daily_total_weight=$waybills->sum('carrier_weight_other');
         $updateParams = [['id','pick_up_fee','updated_at']];

+ 1 - 1
tests/Services/StationTaskBatchService/CreateByBatchesTest.php

@@ -71,10 +71,10 @@ class CreateByBatchesTest extends TestCase
     public function tearDown(): void
     {
         Batch::query()->whereIn('id',data_get($this->data['batches'],'*.id')??[])->delete();
+        StationRuleBatch::query()->where('owner_id',$this->data['owner']['id']??'')->delete();
         StationTask::query()->whereIn('id',data_get($this->data['stationTask'],'*.id')??[])->delete();
         StationTaskBatch::query()->whereIn('id',data_get($this->data['stationTaskBatches'],'*.id')??[])->delete();
         StationTaskChild::query()->whereIn('station_task_id',data_get($this->data['stationTask'],'*.id')??[])->delete();
-        $this->data['stationRuleBatch']->delete();
         Owner::query()->where('id',$this->data['owner']['id']??'')->delete();
         parent::tearDown();
     }

+ 0 - 1
tests/Services/StationTaskBatchService/RunManyTest.php

@@ -74,7 +74,6 @@ class RunManyTest extends TestCase
         $this->data['stationTaskMaterialBoxes']=$this->stationTaskMaterialBoxService->createByBatches($this->data['batches'],$this->data['stationTask']); //注册料箱任务
         $this->data['stationTaskBathes']=$this->stationTaskBatchService->createByBatches($this->data['batches'],$this->data['stationTask']); //注册波次任务
 
-
     }
 
     public function testReturned()

+ 6 - 4
tests/Services/StationTaskCommodityService/CreateByBatchTest.php

@@ -67,8 +67,8 @@ class CreateByBatchTest extends TestCase
             ]
         ]);
 
-        $this->data['stationTaskCommodities']
-            =(function(){
+//        $this->data['stationTaskCommodities']
+//            =(function(){
             if(!isset($this->data['stationTaskCommodities']))
                 $this->data['stationTaskCommodities'] = collect();
             foreach($this->data['batches'] as $batch){
@@ -77,8 +77,10 @@ class CreateByBatchTest extends TestCase
                     $this->service->createByBatch($batch)
                 );
             }
-            return $this->data['stationTaskCommodities'];
-        })();
+//            return $this->data['stationTaskCommodities'];
+//        })();
+
+        $this->data['stationTaskCommodities']=StationTaskCommodity::query()->whereIn('order_id',data_get($this->data['orders'],'*.id')??[])->get();
         $this->assertEquals($this->orderCommodityAmount, $this->data['stationTaskCommodities']->count());
     }
 

+ 3 - 0
tests/Services/StationTaskMaterialBoxService/CreateByBatchesTest.php

@@ -79,6 +79,9 @@ class CreateByBatchesTest extends TestCase
         StationTask::query()
             ->whereIn('id',data_get($this->data['stationTask'],'*.id')??[])
             ->delete();
+        Batch::query()
+            ->whereIn('id',data_get( $this->data['batches'],'*.id')??[])
+            ->delete();
         parent::tearDown();
     }
 }